The php.ini file is a critical file you often need to manage to optimize your Joomla site. It controls many important aspects of what you can and can not do with your site.
For example, it controls the size of the files your server allows your Joomla to upload.
Different hosts use different schemes for storing and accessing critical system files like php.ini. You'll need to research where to find them.
In this tutorial, I will show you how to find the location of the php.ini file on any server.
Step #1. Create a script to display your PHP information
- On your computer, create an empty PHP script called phpinfo.php.
- Place it in your home directory.
- Using a plain text editor paste in your phpinfo.php file this code:
<?php phpinfo(); ?>
- Save the file.
Step #2. Upload phpinfo.php to your site
- In your CPanel, upload this file to the "public_html" directory or whatever your main HTML directory is.
- In your browser address bar, access the file by typing in: https://yourdomain.com/phpinfo.php
You'll get a complete list of all your php settings. In the phpinfo.php page you can see:
- The PHP version at the top of the file.
- The location of your php.ini file.
- Scroll down the page, and you can find the current version of MySQL. You can also find other important PHP settings, such as max_upload_site, for example.
This will work on your local computer using XAMPP or WAMP as well. This is what my XAMPP installation looks like.
GoDaddy servers are a Special Case
When you run phpinfo.php on your GoDaddy server, you'll see the php5.ini file located in /web/config/php5.ini.
This folder is inaccessible using FTP or the File Manager in the control panel.
So you won't be able to make any changes to that php5.ini file if you need to fix errors. As a workaround, make your own php5.ini file and upload it to your "html" directory.
Use FTP or your file manager to upload or create a php5.ini folder in your main directory on GoDaddy servers.
IMPORTANT: on GoDaddy, if you are running PHP 5, name your initialization file php5.ini. Also, always upload the initialization file to the root directory of your site.
Now run your phpinfo.php script and you will see the path to the one you uploaded. You can now edit this php5.ini file to make changes to your PHP settings.
What's Next?
What's Next?
Save $1,000's when you sign up for Joomlashack's Everything Club.
You will get your hands on our extensive range of over 20 extensions, plus legendary support!