How To Change Your PHP Settings on Ubuntu 14.04
How To Change Your PHP Settings on Ubuntu 14.04
If you're running PHP on Ubuntu 14.04, you may need to change some of the default settings in order to get your website or application working properly. Here's how:
Step 1: Locate Your php.ini File
The php.ini file is where you can find and modify the settings for your PHP installation. To find it, open up a terminal window and type:
sudo nano /etc/php5/apache2/php.ini
This will open up the php.ini file in the nano text editor. You can use a different text editor if you prefer, but nano is a good choice for beginners.
Step 2: Edit Your Settings
Once you have the php.ini file open, you can start making changes to the settings. Some common settings you may need to change include:
- upload_max_filesize: The maximum size of files that can be uploaded to your server.
- post_max_size: The maximum size of POST data that can be sent to your server.
- max_execution_time: The maximum amount of time a PHP script can run before it is terminated.
- memory_limit: The maximum amount of memory a PHP script can use.
To change a setting, simply locate it in the php.ini file and modify the value. For example, if you want to increase the maximum file upload size to 100 MB, you would change the following line:
upload_max_filesize = 2M
To:
upload_max_filesize = 100M
Save your changes by pressing Ctrl+X, then Y, then Enter.
Step 3: Restart Apache
After making changes to the php.ini file, you need to restart Apache in order for the changes to take effect. To do this, type the following command in your terminal:
sudo service apache2 restart
Your new PHP settings should now be in effect!
Комментарии
Отправить комментарий