Page 1 of 1

Where php.ini is located

Posted: Sun Jul 26, 2020 12:18 am
by myVesta
Location of php.ini is /etc/php/X.X/fpm/php.ini
(where X.X is 7.4 for example)

To check what PHP version your site is running, in your SSH run:

Code: Select all

sudo /usr/local/vesta/bin/v-get-php-version-of-domain yourdomain.com
After you make the changes in /etc/php/X.X/fpm/php.ini , you should restart php-fpm (do it in SSH):

Code: Select all

sudo systemctl restart phpX.X-fpm
(where X.X is 7.4 for example)



Important note:
  • pm.max_children
  • memory_limit
  • max_execution_time (also consider: request_terminate_timeout)
  • upload_max_filesize
  • post_max_size
  • open_basedir
  • upload_tmp_dir
  • sendmail_path
  • mysql.allow_persistent
  • safe_mode
... are overrided in /etc/php/X.X/fpm/pool.d/yourdomain.com.conf files.
These variables you should change there.
Also restart php-fpm after those changes.

If you need different default values for newly created domains, edit /usr/local/vesta/data/templates/web/apache2/PHP-FPM-XX.sh files (where XX is 74 for example).

Additional notes:
  • Every time when you increase or decrease max_execution_time, you should also increase/decrease request_terminate_timeout.
    Variable request_terminate_timeout is given in real seconds (default value is 90s), and max_execution_time is not.
    Variable max_execution_time is measured in CPU time spent on the current process. More about this could be found here: https://stackoverflow.com/questions/100 ... 0#10027320
    What is important for us is that max_execution_time could last a lot longer than 30 seconds if some process got stuck with IO waiting. That's why request_terminate_timeout is important and would prevent a potential indefinite IO waiting.

Re: Where php.ini is located

Posted: Sat May 01, 2021 7:13 am
by 1webdomain
THX

Re: Where php.ini is located

Posted: Mon Nov 15, 2021 10:46 am
by crafter
I just did a fresh install of myvesta and try to edit the php file but my php.ini file is blank. I input the desired values in basic form but it keeps erasing and I paid for the file manger addon and got it up but I still can't get to edit the /etc/php/7.3/fpm/php.ini file like you stated in this post. what am i missing please?

Re: Where php.ini is located

Posted: Mon Nov 15, 2021 10:57 am
by myVesta
crafter wrote: Mon Nov 15, 2021 10:46 am I just did a fresh install of myvesta and try to edit the php file but my php.ini file is blank. I input the desired values in basic form but it keeps erasing and I paid for the file manger addon and got it up but I still can't get to edit the /etc/php/7.3/fpm/php.ini file like you stated in this post. what am i missing please?
FileManager can't reach /etc/php/7.3/fpm/php.ini

Please screenshot your SSH console while you are trying to edit /etc/php/7.3/fpm/php.ini
Also, please mention what Debian version you are using?

Re: Where php.ini is located

Posted: Mon Nov 15, 2021 11:15 am
by crafter
I'm using Debian 10. i use Putty to access ssh as root. I'm a novice so i just copy and paste the command line you put up here and follow instructions. so i input: /etc/php/7.3/fpm/php.ini and got "-Bash: /etc/php/7.3/fpm/php.ini: Permission denied.

The problem is i want to change the Post max, max input, memory limit etc of the php 7.3 but it wasn't saving and the advance editing option only shows: "Usage: CONFIG" and nothing else but I'm familiar with editing php.ini file so i know there should be more.

Furthermore, the vesta-php configuration link takes me to a page that shows: "Page not Found"

Re: Where php.ini is located

Posted: Mon Nov 15, 2021 11:41 am
by myVesta
crafter wrote: Mon Nov 15, 2021 11:15 am I'm using Debian 10. i use Putty to access ssh as root. I'm a novice so i just copy and paste the command line you put up here and follow instructions. so i input: /etc/php/7.3/fpm/php.ini and got "-Bash: /etc/php/7.3/fpm/php.ini: Permission denied.
In SSH type:

Code: Select all

sudo mcedit /etc/php/7.3/fpm/pool.d/your-domain.com.conf
Save with F2 keyboard key.
Exit with ESC keyboard key.

Then restart php7.3:

Code: Select all

sudo systemctl restart php7.3-fpm
Also, you cen edit php.ini by typing:

Code: Select all

sudo mcedit /etc/php/7.3/fpm/php.ini
but almost all changes you need to do in /etc/php/7.3/fpm/pool.d/YOUR-DOMAIN.COM.conf

Re: Where php.ini is located

Posted: Tue Nov 16, 2021 3:31 am
by crafter
These steps worked like magic :shock: . Thank you very much and especially for how fast you responded. More codes to your brain :ugeek:

Re: Where php.ini is located

Posted: Fri Dec 02, 2022 10:58 am
by tienloc1
About this part:
Additional notes:
Every time when you increase or decrease max_execution_time, you should also increase/decrease request_terminate_timeout.
Variable request_terminate_timeout is given in real seconds (default value is 90s), and max_execution_time is not.
Variable max_execution_time is measured in CPU time spent on the current process. More about this could be found here: https://stackoverflow.com/questions/100 ... 0#10027320
What is important for us is that max_execution_time could last a lot longer than 30 seconds if some process got stuck with IO waiting. That's why request_terminate_timeout is important and would prevent a potential indefinite IO waiting.
I don't have knowledge about the php value so could you help about this question:

I need to increase the max_execution_time to 300, so I will need to increase request_terminate_timeout to 300 too?

Re: Where php.ini is located

Posted: Mon May 22, 2023 7:30 am
by itsjaredfilm
My php.ini file is blank just says config and that is it.