• 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
Facebook Twitter Pinterest

Abhishek Ghosh

About Abhishek Ghosh

Abhishek Ghosh is a Businessman, 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)

  • Nginx WordPress Installation Guide (All Steps)

    This is a Full Nginx WordPress Installation Guide With All the Steps, Including Some Optimization and Setup Which is Compatible With WordPress DOT ORG Example Settings For Nginx.

  • WordPress Multisite on Nginx on Ubuntu 14.04 on HP Cloud

    Here is a Step by Step Guide on Setting Up WordPress Multisite on Nginx on Ubuntu 14.04 on HP Cloud with All Commands and the Configuration.

  • Zend Opcache Optimization for Nginx Ubuntu (HP Cloud)

    Here is Full Guide to Zend Opcache Optimization for Nginx PHP5-FPM for Ubuntu Server Running on HP Cloud. We Suggest to Use Zend Opcache over APC.

  • Ubuntu Nginx PHP5-FPM UNIX Socket Configuration

    Some Extra Steps Needed to Perform in Ubuntu for the Right Nginx PHP5-FPM UNIX Socket Configuration. Else You’ll Face Random 502, 504 Error.

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

Get new posts by email:

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 (24.3K Followers)
  • Twitter (5.8k 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

  • Hybrid Multi-Cloud Environments Are Becoming UbiquitousJuly 12, 2023
  • Data Protection on the InternetJuly 12, 2023
  • Basics of BJT TransistorJuly 11, 2023
  • What is Confidential Computing?July 11, 2023
  • How a MOSFET WorksJuly 10, 2023
PC users can consult Corrine Chorney for Security.

Want to know more about us?

Read Notability and Mentions & Our Setup.

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

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