• Home
  • Archive
  • Tools
  • Contact Us

The Customize Windows

Technology Journal

  • Cloud Computing
  • Computer
  • Digital Photography
  • Windows 7
  • Archive
  • Cloud Computing
  • Virtualization
  • Computer and Internet
  • Digital Photography
  • Android
  • Sysadmin
  • Electronics
  • Big Data
  • Virtualization
  • Downloads
  • Web Development
  • Apple
  • Android
Advertisement
You are here: Home » Optimize php ini for Rackspace Cloud Server (PVHVM)

By Abhishek Ghosh May 2, 2014 4:56 am Updated on May 2, 2014

Optimize php ini for Rackspace Cloud Server (PVHVM)

Advertisement

Here is a quick guide to optimize php ini for Rackspace Cloud Server (PVHVM) for higher performance and lower page loading speed. We talked about PVHVM Virtualization Mode. You probably know about guides on APC Configuration and Optimization for Rackspace Cloud Server (PVHVM), Rackspace Cloud Database, Install APC, Tweak MySQL my.cnf, use Varnish Cache etc. Also, you can read Memcached Configuration and Optimization for Rackspace Cloud Server.

Also, it is suggested to read Hardening Rackspace Cloud Server for WordPress. Last but the most important remaining is Optimize php ini for Rackspace Cloud Server (PVHVM).

 

Optimize php ini for Rackspace Cloud Server (PVHVM) : Basics

 

It is funny, but there are many unknown sources to optimize php ini file, for example; by Apple Inc :
http://www.opensource.apple.com/source/apache_mod_php/apache_mod_php-4.3/php/php.ini-optimized?txt
On Linux, for normal LAMP server installation; php.ini file is located at :

Advertisement

---

Vim
1
/etc/php5/apache2

To find php.ini, we need to run :

Vim
1
php --ini

You will get this kind of output :

Vim
1
2
3
4
5
6
7
8
9
10
Configuration File (php.ini) Path: /etc/php5/cli
Loaded Configuration File:         /etc/php5/cli/php.ini
Scan for additional .ini files in: /etc/php5/cli/conf.d
Additional .ini files parsed:      /etc/php5/cli/conf.d/curl.ini,
/etc/php5/cli/conf.d/pdo.ini,
/etc/php5/cli/conf.d/pdo_sqlite.ini,
/etc/php5/cli/conf.d/sqlite.ini,
/etc/php5/cli/conf.d/sqlite3.ini,
/etc/php5/cli/conf.d/xdebug.ini,
/etc/php5/cli/conf.d/xsl.ini

Like, we ran the command on our Mac running OS X 10.9 :

Optimize php ini for Rackspace Cloud Server

Also, you can run a simple command :

Vim
1
php -i | grep 'php.ini'

It will only give you the output of the location :

Vim
1
Loaded Configuration File => /usr/local/lib/php.ini

Optimize-php-ini-for-Rackspace-Cloud-Server-(PVHVM)

For PHP-MySQL based web softwares like WordPress, editing this php.ini wrongly can fully make the system unstable. So, always read the documentation from official website first to know the function. Take a backup of the file (its quite bigger) via FTP client like Filezilla, edit a copied version on plain text editor locally and replace it via FTP, in case you are not used with command line. If you are logging to FTP as root, binary transfer mode has no difference than editing on nono on command line. Plus, FTP way will allow to keep the original file as backup by renaming – very easy to restore. If you edit wrongly, running the grep command with -i flag might show up :

Vim
1
2
Configuration File (php.ini) Path   /etc/php5/apache2
Loaded Configuration File   /etc/php5/apache2/php.ini

It simply means your configuration is not read. A syntax error in php.ini in line numbered x, will render next all the syntax not excite.

We should restart the Apache after editing :

Vim
1
sudo service apache2 restart

Do not edit on FTP client like Filezilla in all cases, it is a handy tip for testing settings for huge changes.
php.ini can make a site load quite badly or can make it fully optimized. If you create a php file with this :

Vim
1
2
3
4
<!--?php
// Show all php information
phpinfo();
?-->

and load the file on browser, you will get all the information. Also, if you want a crazy nice script, you can download it from this article to get maximum possible information about php.

Also, this file determines the maximum uploading size like basic functions. Official documentation :

Vim
1
http://www.php.net/manual/en/configuration.file.php

 

Optimize php ini for Rackspace Cloud Server (PVHVM) : Things

 

This an universal suggested php.ini configuration to optimize php.ini for one 01 GB server instance (we are taking that MySQL server is not on the same host, if on the same host, adjust according to load value, setting memory to ¼th is safer, ;; or ; are comments) :

Vim
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
memory_limit = 512M
max_execution_time = 360
max_input_time = 900
post_max_size = 50M
upload_max_filesize = 900M
;; more here
realpath_cache_size = 64k
realpath_cache_ttl = 3600
;;
; Allow files to be uploaded
file_uploads = On
; Allow external URLs to be opened
allow_url_fopen = On
; Disable PHP register globals
register_globals = Off
; Enable GZIP compression at the default level
zlib.output_compression = On
zlib.output_compression_level = 6
; Load mcrypt extension
extension=mcrypt.so
;; cookies using Mcrypt is faster than the Blowfish that is used by default
; Disable PHP magic quotes
magic_quotes_gpc = Off
magic_quotes_runtime = Off
magic_quotes_sybase = Off
; Load PDO MySQL extension
extension=pdo.so
extension=pdo_mysql.so
;; zend path is not right, check yours
zend_extension=/usr/local/.../xdebug.so
xdebug.profiler_enable=1
xdebug.profiler_aggregate = On
xdebug.profiler_output_dir=/tmp

Editing parameters on /etc/php5/fpm/php.ini will be the same in case php-fpm is running. You probably should edit (for fpm) :

Vim
1
/etc/php5/fpm/pool.d/

You need to fine tune PHP5-FPM with an example server with 1GB RAM. With12GB RAM, you can dedicate 700MB RAM for PHP and the rest for other processes if MySQL server is different. Now what files are there? for example; APC config :

Vim
1
/etc/php5/conf.d/apc.ini

We actually did that part on previous guides! At any time, you can test instantly your tweak by calling the functions.

Tagged With wordpress php ini optimization , optimization icloud com

This Article Has Been Shared 616 Times!

Facebook Twitter Pinterest
Abhishek Ghosh

About Abhishek Ghosh

Abhishek Ghosh is a Businessman, Orthopaedic Surgeon, Author and Blogger. You can keep touch with him on Twitter - @AbhishekCTRL.

Here’s what we’ve got for you which might like :

Articles Related to Optimize php ini for Rackspace Cloud Server (PVHVM)

  • How to Build a Private Cloud

    Building a Private Cloud infrastructure is not very easy for building a Company’s IT Infrastructure. Many brand and Open Source Projects.has various resources.

  • iOS App in SWIFT Language to List the Available Fonts

    Here is a Free Software, an iOS App written in Swift Language or what Apple said Objective-C without the C. Download and modify yourself.

  • Database as a Service and Development of Applications

    Database as a Service and Development sings well as it waives off the anxiety related to stability of the web or mobile device application.

  • Guide to Install VNC Server on Ubuntu 14.04 on Rackspace Cloud

    This Guide describes how to install VNC Server on Ubuntu 14.04 on Rackspace Cloud with step by step commands. The server becomes a desktop.

  • WP-CLI and Cloud Server

    With Cloud Automation, we can integrate WP-CLI, a command line tool for WordPress for better, easy and faster management on Cloud Server.

Additionally, performing a search on this website can help you. Also, we have YouTube Videos.

Take The Conversation Further ...

We'd love to know your thoughts on this article.
Meet the Author over on Twitter to join the conversation right now!

If you want to Advertise on our Article or want a Sponsored Article, you are invited to Contact us.

Contact Us

Subscribe To Our Free Newsletter

You can subscribe to our Free Once a Day, Regular Newsletter by clicking the subscribe button below.

Click To Subscribe

Please Confirm the Subscription When Approval Email Will Arrive in Your Email Inbox as Second Step.

Search this website…

 

Popular Articles

Our Homepage is best place to find popular articles!

Here Are Some Good to Read Articles :

  • Cloud Computing Service Models
  • What is Cloud Computing?
  • Cloud Computing and Social Networks in Mobile Space
  • ARM Processor Architecture
  • What Camera Mode to Choose
  • Indispensable MySQL queries for custom fields in WordPress
  • Windows 7 Speech Recognition Scripting Related Tutorials

Social Networks

  • Pinterest (21K Followers)
  • Twitter (5.3k Followers)
  • Facebook (5.7k Followers)
  • LinkedIn (3.7k Followers)
  • YouTube (1.3k Followers)
  • GitHub (Repository)
  • GitHub (Gists)
Looking to publish sponsored article on our website?

Contact us

Recent Posts

  • Basics on Python Tornado (web server) March 8, 2021
  • What You Need to Know About Hybrid Mobile App Development March 6, 2021
  • Why Not to Use Your Host for Email Marketing March 5, 2021
  • What You Need to Know About the Microservices March 4, 2021
  • Fix Missing/Bad FileProvider for Freshchat (Android error code 354) March 3, 2021

 

About This Article

Cite this article as: Abhishek Ghosh, "Optimize php ini for Rackspace Cloud Server (PVHVM)," in The Customize Windows, May 2, 2014, March 8, 2021, https://thecustomizewindows.com/2014/05/optimize-php-ini-for-rackspace-cloud-server-pvhvm/.

Source:The Customize Windows, JiMA.in

 

This website uses cookies. If you do not want to allow us to use cookies and/or non-personalized Ads, kindly clear browser cookies after closing this webpage.

Read Cookie Policy.

PC users can consult Corrine Chorney for Security.

Want to know more about us? Read Notability and Mentions & Our Setup.

Copyright © 2021 - The Customize Windows | dESIGNed by The Customize Windows

Copyright  · Privacy Policy  · Advertising Policy  · Terms of Service  · Refund Policy