You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

修改php.ini后phpinfo未生效,Scaleway主机CentOS+VestaCP配置求助

Fixing PHP Configuration File Not Loading in VestaCP (CentOS on Scaleway)

Hey there, let's work through this issue together—it's a super common gotcha with VestaCP since it manages multiple PHP versions and config overrides behind the scenes. Here's how to get your php.ini changes to stick:

1. Confirm Which PHP Version Your Site Is Using

First, check the PHP Version listed at the top of your phpinfo() output. VestaCP often installs multiple PHP versions (like 7.4 or 8.1), and each has its own separate php.ini file—the /etc/php.ini you edited is likely for the CLI version, not the web/FPM version your site actually uses.

2. Locate the Correct php.ini File for Your PHP Version

VestaCP stores PHP-FPM configs in version-specific directories. For example:

  • For PHP 7.4: /etc/php/7.4/fpm/php.ini
  • For PHP 8.1: /etc/php/8.1/fpm/php.ini

You can also run this SSH command to find the exact FPM config path for your active PHP version:

php-fpm<version> -i | grep "Loaded Configuration File"

(Replace <version> with your PHP version, e.g., php-fpm74 -i | grep "Loaded Configuration File")

3. Edit the Correct php.ini and Update max_execution_time

Open the FPM-specific php.ini with your preferred editor (like nano):

nano /etc/php/<version>/fpm/php.ini

Find the max_execution_time line, uncomment it if needed, and set your desired value:

max_execution_time = 300 ; Adjust this to your needs, e.g., 300 seconds

Save and exit (for nano: press Ctrl+O, hit Enter, then Ctrl+X).

4. Check for VestaCP Panel Overrides

VestaCP lets you set PHP settings per-site, which will override your php.ini changes:

  1. Log into your VestaCP panel
  2. Go to the Web tab, find your site, and click Edit
  3. Scroll down to the PHP Settings section
  4. Look for max_execution_time—if there's a value entered here, delete it (or set it to your desired value) to let the php.ini take effect
  5. Save the changes

5. Restart PHP-FPM to Apply Changes

Your new config won't take effect until you restart the PHP-FPM service. Run the appropriate command for your PHP version:

# For PHP 7.4
systemctl restart php-fpm74

# For PHP 8.1
systemctl restart php-fpm81

# Generic fallback if you're unsure
systemctl restart php-fpm

6. Verify the Fix

Refresh your phpinfo() page and check two key values:

  • Loaded Configuration File: Should now show the path to the FPM php.ini you edited
  • max_execution_time: Should display your updated value

Bonus: Check for Pool Config Overrides

If it's still not working, check your site's PHP-FPM pool config (VestaCP creates these per domain):

nano /etc/php/<version>/fpm/pool.d/<your-domain>.conf

Look for lines like php_admin_value[max_execution_time] = 60—if present, this will override php.ini. Either comment it out (add a ; at the start) or update the value to match your php.ini setting, then restart PHP-FPM again.


内容的提问来源于stack exchange,提问作者Hakan Erdur

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.05.25 06:35:39