Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

changing php.ini has no effect on my EC2 instance's PHP config

I'm running an Apache server in a micro instance from Amazon AWS, and I need to change the session duration and the max upload limit.

When I edit php.ini and restart Apache, changes don't show in Apache.

I wasn't able to find any info on this.

What can I do? is there any file overriding php.ini that you know of?

like image 401
naico777 Avatar asked Nov 28 '13 00:11

naico777


People also ask

Do changes to PHP ini require restart?

Changes made to the php. ini file will not take effect until you restart the server.

How do I change my EC2 instance configuration?

To edit an instance's configurationStop the instance, if it is not already stopped. On the Instances page, click an instance name to display the Details page. Click Edit to display the edit page. Edit the instance's configuration, as appropriate.

Where is my AWS PHP ini?

It is located at /opt/bitnami/php/etc/php. ini. For example, to modify the default upload limit for PHP, update the PHP configuration file following these instructions.


2 Answers

Since PHP on Amazon Linux ran with FPM/FastCGI I had to do:

sudo systemctl restart php-fpm.service

before restarting apache, i.e

sudo systemctl restart httpd.service

like image 157
Arvind K. Avatar answered Oct 30 '22 02:10

Arvind K.


Which config file are you editing? When you do a phpinfo() what is the path shown under Loaded Configuration File? Edit the php.ini that it says it is loading & your changes should be reflected.

If you don’t know how phpinfo() works, just create a file on your server called something like:

phpinfo_test.php

In that file place this code:

<?php
  phpinfo();
?>

Now load phpinfo_test.php from that web server.

like image 27
Giacomo1968 Avatar answered Oct 30 '22 01:10

Giacomo1968