大网数据广告活动
网站运营与故障问答

Cloudlinux + CageFS + PHP Selector - how to update default php.ini for each PHP version or for each domain account?

· 52CE 我爱测

My server runs Cloudlinux 5.11 with CageFS and PHP Selector. Default PHP version is 5.3. I have one account using PHP 5.3, one account using PHP 5.5, and one account using PHP 5.6. I'm trying to figure out how to update each acco…

问题原文

原帖链接 · Shawn · CC BY-SA 3.0

My server runs Cloudlinux 5.11 with CageFS and PHP Selector. Default PHP version is 5.3.

I have one account using PHP 5.3, one account using PHP 5.5, and one account using PHP 5.6.

I'm trying to figure out how to update each account's php.ini or each PHP version's default php.ini.

So far I've figured out how to update PHP 5.3's default php.ini:

  1. phpinfo on the PHP 5.3 account shows the loaded configuration file is from /usr/selector.etc/php.ini.

  2. Update /usr/local/lib/php.ini

  3. Run cagefsctl --force-update

  4. Rebuild Apache

Then the modified /usr/local/lib/php.ini is reflected on the phpinfo.

However, for PHP 5.5. and 5.6 accounts, I can't figure out how to update their default php.ini's.

  1. Their phpinfo shows the loaded configuration files are from /opt/alt/php55/etc/php.ini and /opt/alt/php56/etc/php.ini

  2. Update those files

  3. Run cagefsctl --force-update

  4. Rebuild Apache

Afterwards, the changes of these php.ini's are reverted! So where is the right place to change these PHP versions' default php.ini's?

Being able to update each PHP version's default php.ini would work for me, but it would be even easier and more flexible if each domain account (or even each folder) can have its own php.ini.

I've tried /public_html/php.ini and /public_html/.htaccess. They don't take effect at all. ini_set in script works though, but of course I don't want to reply on just ini_set.

已采纳解答

原帖链接 · Shawn · CC BY-SA 3.0

Found the answer. For alternative PHP versions, the process is different.

After modifying /opt/alt/phpXX/etc/php.ini

Run cagefsctl --rebuild-alt-php-ini

That's it. No need to rebuild apache.

For an individual user's php.ini, check here

摘自公开归档,保留原文语言,版式经整理,外部媒体与邮箱地址已移除。

资料来源与适用范围

资料来源
Webmasters Stack Exchange
适用范围
以原帖系统、软件版本与发布日期为准(2016-03-03)
内容语言
中文;命令、路径和错误标识保留技术原文
本地收录日期
2026-11-15
授权说明
CC BY-SA 3.0

正文与所需资源由本站本地存储。查看来源及更新记录 ↗

请按适用版本和实际日志确认原因;本站没有对每一种系统或设备逐项执行文中的操作。