How to Find the Location of Your Joomla php.ini File

How to Find the Location of Your php.ini File

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

tutuploadsmedia_1330111995810.png

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

tutuploadsmedia_1330112143774.png

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

tutuploadsmedia_1330112626882.png

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.

tutuploadsmedia_1330112876304.png

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.

tutuploadsmedia_1330113031325.png

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?

Save $1,000's when you sign up to Joomlashack's Everything Club.

You will get access to all our 32 extensions, and legendary support!

  Click here to join the Everything Club