Miscellaneouss

How to Edit PHP.INI File

PHP.INI file is the default configuration file for application that require PHP. PHP.INI file is used to control variables like upload file size, resource limits, file timeouts etc..

In this tutorial I will guide how you can edit php.ini file for your running application.

The most common parameters changed in the php.ini file are:

safe_mode
register_globals
upload_max_filesize
post_max_size
max_execution_time

If you’re experiencing difficulty with your web application, you can edit the php.ini or create a new text file. For example, you’re unable to install a WordPress theme or plugin through your WP Dashboard.

Please make a copy Before making any changes, it’s a good idea to copy the original settings, both for reference and to easily restore the original if necessary.

Prerequisites

1. Root access should be enabled on the server.
2. To know how to connect your server via SSH.

Edit PHP.INI File

Use the below command to edit the php.ini file.

Global php.ini

Follow the below command at the command prompt to start editing the global php.ini file.

# vim /etc/php.ini

When you are finished editing your php.ini, you will need to restart your Apache server. Run the following command:

# /etc/init.d/httpd restart

Domain Specific PHP.INI

Plesk 11.0 and later features a domain-specific php.ini file. This domain-level version of php.ini overrides the global php.ini settings. There are two main ways to edit this file.

Via Plesk

You can edit the domain-level php.ini file using Plesk Control Panel. Follow the below steps to edit the php.ini file.

1. Select the Websites and domain tab.

2. Expand the advanced options by clicking the arrow.

edit-php-ini-file

3. Select PHP setting from the menu.

php-version

4. Most common PHP directives are in this page and ready for you to modify. You can select common options from the drop-down menus, or create your own by using the “Custom Variable” option. For directives that are not listed, raw text can be input in the box at the bottom of this screen.

5. Click “OK” at the bottom to save.

If you choose to use the Plesk “PHP Settings” menu to edit php.ini, it will overwrite any manual changes you have made to /var/www/vhosts/DOMAIN/etc/php.ini via SSH or FTP.

Via SSH

First of all you will need to login server via SSH.

Use the following command to start editing the domain-level php.ini:

# vim /var/www/vhosts/DOMAIN/etc/php.ini

Be sure to replace DOMAIN with the domain name you want to edit.

When you are finished editing your php.ini, you will need to restart your Apache server. Run the following command:

# /etc/init.d/httpd restart
Thank you! for visiting Look Linux.

If you find this tutorial helpful please share with your friends to keep it alive. For more helpful topic browse my website www.looklinux.com. To become an author at Look Linux Submit Article. Stay connected to Facebook.

About the author

mm

Santosh Prasad

Hi! I'm Santosh and I'm here to post some cool article for you. If you have any query and suggestion please comment in comment section.

Leave a Comment