• 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 » Ubuntu 22.04 php.ini Optimization (Apache)

By Abhishek Ghosh February 1, 2024 8:00 am Updated on February 1, 2024

Ubuntu 22.04 php.ini Optimization (Apache)

Advertisement

If you have followed our previous guides, such as How to Install Apache and PHP on Ubuntu 22.04 Server, then you need to follow this guide for optimum performance of the web server. If you are running a WordPress website or web app with PHP, you may have faced performance problems. Fortunately, these tweaks can make your website fast running.

 

Which php.ini to Tweak?

 

Install the mlocate package, update the database and find the php.inifiles:

Vim
1
2
3
sudo apt install mlocate
sudo updatedb
locate php.ini

Example output:

Advertisement

---

Vim
1
2
3
4
5
6
7
8
9
10
11
12
locate php.ini
/etc/php/7.2/cgi/php.ini
/etc/php/7.2/cli/php.ini
/etc/php/7.2/fpm/php.ini
/etc/php/8.3/apache2/php.ini
/etc/php/8.3/cli/php.ini
/usr/lib/php/7.2/php.ini-development
/usr/lib/php/7.2/php.ini-production
/usr/lib/php/7.2/php.ini-production.cli
/usr/lib/php/8.3/php.ini-development
/usr/lib/php/8.3/php.ini-production
/usr/lib/php/8.3/php.ini-production.cli

If you are using PHP 7.2, then in the above case edit at least /etc/php/7.2/cli/php.ini and /etc/php/7.2/fpm/php.ini. Reload PHP-FPM after editing with service php7.2-fpm reload command.

Ubuntu 22-04 php-ini Optimization Apache

 

Essential php.ini Tweaks

 

These are all the required settings which you can change:

Vim
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
memory_limit = 256M
...
max_execution_time = 120
...
display_errors = Off
...
upload_max_filesize = 64M
post_max_size = 64M
allow_url_fopen = Off
...
realpath_cache_size = 16M
realpath_cache_ttl = 120
...
session.save_handler = files
session.save_path = /var/lib/php/sessions
session.cache_limiter = public
session.cache_expire = 180

The above parameters are not in one place, you have to find the settings, uncomment if commented out and change the settings. I have seen that these are optimum for stability and performance for a WordPress installation on a 16GB server. These settings probably do not work for multiple server setups.

Tagged With 10 Essential PHP ini Tweaks for Improved Web Performance
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 Ubuntu 22.04 php.ini Optimization (Apache)

  • 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.

  • Optimize php ini for Rackspace Cloud Server (PVHVM)

    Here is a quick guide to optimize php ini for Rackspace Cloud Server (PVHVM) for higher performance and lower page loading speed.

  • 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.

  • 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.

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…

 

vpsdime

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

  • Cloud-Powered Play: How Streaming Tech is Reshaping Online GamesSeptember 3, 2025
  • How to Use Transcribed Texts for MarketingAugust 14, 2025
  • nRF7002 DK vs ESP32 – A Technical Comparison for Wireless IoT DesignJune 18, 2025
  • Principles of Non-Invasive Blood Glucose Measurement By Near Infrared (NIR)June 11, 2025
  • Continuous Non-Invasive Blood Glucose Measurements: Present Situation (May 2025)May 23, 2025
PC users can consult Corrine Chorney for Security.

Want to know more about us?

Read Notability and Mentions & Our Setup.

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

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