Reputation: 712
Hey guys I have a aws EC2 Instance running however I need to edit the
upload_max_filesize
and the post_max_size
in the php ini file. Im having trouble locating this file. How would I got about finding it? I need to upload bigger files than I currently can. Thanks!
Upvotes: 2
Views: 17545
Reputation: 1217
I finally found a solution (updated on May 2023)
php.ini file found on /etc/php/7.4/apache2/php.ini
You can change the values here and restart the Apache Server.
It will work.
I have created a complete tutorial for this.
Please have a look at php.ini aws ec2 tutorial
Upvotes: 1
Reputation: 712
Its actually easier to create an .htaccess file and place it in the root directory of your EC2 instance. filling the file with the values you need like this.
php_value upload_max_filesize 3000M
php_value post_max_size 3000M
php_value memory_limit 3000M
this keeps you from directly editing php's configuration directly and makes it much easier to maintain.
Upvotes: 3
Reputation: 792
You can create .php page with:
<?php
phpinfo();
?>
That should show you where currently used php.ini is located.
Usually it might be at:
/etc/php5/apache2/php.ini
But checking with that phpinfo file is safer.
Upvotes: 1