Modify PHP Settings
PHP is a powerful server-side, highly customizable scripting language. Configuration changes are done by editing the server-wide configuration file, called php.ini. This guide will show you how to change the server-wide configuration of PHP on Linux and Windows based managed servers.
In order to modify PHP settings, please log in as root user (Linux) or Administrator user (Windows). |
Modify PHP Configuration on Linux
1 |
Log in to your server via SSH as the root user |
||
2 |
Locate the php.ini file, which is usually found in:
/etc/php.ini
The location, however, may vary. To find it, you may run:
#locate php.ini |
||
3 |
Once you know the location of the php.ini file, you need to change the current working directory to it. Then you can edit the file using any editor. i.e:
#vim php.ini
Save your changes.
|
||
4 |
Restart the Apache webserver:
#/etc/init.d/httpd restart ( on RHEL ) #/etc/init.d/apache2 restart ( on Debian ) |
Modify PHP Configuration on Windows
1 |
Login to your server via RDP with an Administrator account |
2 |
Locate the php.ini file. If needed, search for the file using the Windows Search utility. |
3 |
Open the folder in Windows Explorer and edit the php.ini file using any text editor. Save your changes. |
4 |
Restart the IIS webserver. The fastest way for you to do so is via Command Prompt by typing:
iisreset /restart |
We suggest reviewing the official documentation describing the roles of the directives found in the global php.ini file before editing the file. Please visit the official PHP website:
|