dongzhuo1930 2016-09-21 20:56
浏览 35

Php5 - 有一种方法可以为每个VirtualHosts配置不同的* .ini文件吗?

I have a doubt about Apache 2.4.7 and Php5, there is a way to configure different * .ini files for each VirtualHosts?

Example, if I have a VH working on 80 port with the rules of the global php.ini (/etc/php5/apache2/php.ini), another in 8080 port that has access to the exec() function and another in 9090 with access to pcntl_fork() function, that I want is only 9090 can access to pcntl_fork() but 80 and 8080 not, same for 8080, this VH only can access to exec() but 80 and 9090 not.

I have been tried with PHPIniDir, but when apache loads a * .ini file, the three VH's (80,8080 and 9090) can use all functions exec and pcntl_fork(),

I tried to use the tags [PATH=/var/www/vhost_8080] and [HOST=localhost:8080] in the global php.ini to load each function, but phpinfo() does not recognize them , also use the Fcgi module (FcgidInitialEnv PHPRC "/var/www/vhost_8080") in VH config setting the path where the ini file is.

Summarized what I want to achieve is restrict the php functions for each virtualhost for security reasons. Any ideas?

Thanks in advance.

Ps. Sorry for the bad english

  • 写回答

0条回答 默认 最新

    报告相同问题?

    悬赏问题

    • ¥15 装 pytorch 的时候出了好多问题,遇到这种情况怎么处理?
    • ¥20 IOS游览器某宝手机网页版自动立即购买JavaScript脚本
    • ¥15 手机接入宽带网线,如何释放宽带全部速度
    • ¥30 关于#r语言#的问题:如何对R语言中mfgarch包中构建的garch-midas模型进行样本内长期波动率预测和样本外长期波动率预测
    • ¥15 ETLCloud 处理json多层级问题
    • ¥15 matlab中使用gurobi时报错
    • ¥15 这个主板怎么能扩出一两个sata口
    • ¥15 不是,这到底错哪儿了😭
    • ¥15 2020长安杯与连接网探
    • ¥15 关于#matlab#的问题:在模糊控制器中选出线路信息,在simulink中根据线路信息生成速度时间目标曲线(初速度为20m/s,15秒后减为0的速度时间图像)我想问线路信息是什么