Zend Server 和 auto_prepend_file(或 php_value)

发布于 2024-08-24 18:01:18 字数 423 浏览 1 评论 0原文

在我们的开发 PC 上,我们需要一个前置文件(通过 php.ini 中的 auto_prepend_file 加载)来设置多个路径。这个 prepend.php 文件在我们所有的服务器上使用,帮助我们轻松配置所有应用程序。

但是 Zend Server 5 GUI (http://localhost:10081/ZendServer/) 在 auto_prepend_file 时不起作用设置后,Apache 不接受 htaccess 或 httpd.conf 文件中的 php_value 指令(因为 FastCGI)。

您是否有想法为我们的代码添加一个前置文件,但不为 ZS GUI 添加前置文件?

谨致问候,
塞德里克

On our development PC we need to have a prepend file (loaded via auto_prepend_file in php.ini) to set up severals paths. This prepend.php file is used on all of our server and help us to easily configure all applications.

But the Zend Server 5 GUI (http://localhost:10081/ZendServer/) does not work when auto_prepend_file is set, and Apache does not accept php_value directive, either in htaccess or httpd.conf files (because of FastCGI).

Do you have any idea to have a prepend file for our code, but not for ZS GUI?

Best regards,
Cédric

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

眼波传意 2024-08-31 18:01:18

http://php.net/manual/en/configuration.file.php 说:

在这些位置搜索 php.ini(按顺序):

。 。 。

您可以查看此列表,看看其中一项技术是否对您的情况有帮助。例如,您可以设置环境变量 PHPRC,或者可以在每个当前工作目录中放置不同的 php.ini 文件,假设每个虚拟主机都有不同的 cwd。

请注意,当使用 Apache 和 mod_php 或在 Web 服务器中嵌入 PHP 的其他模块(例如 FastCGI)时,在 Web 服务器启动时会读取一次 php.ini 文件。当您以 CGI 方式使用 PHP 时,每次 Web 请求期间都会读取 php.ini 文件,因此您有更多机会使用不同的 php.ini

http://php.net/manual/en/configuration.file.php says:

php.ini is searched in these locations (in order):

. . .

You can review this list and see if one of the techniques helps in your case. For example, you can set the environment variable PHPRC, or you can put a different php.ini file in each current working directory, assuming each virtual host has a distinct cwd.

Note that when using Apache and mod_php, or other module embedding PHP in the web server (e.g. FastCGI), the php.ini file is read once, at web server startup. When you use PHP in a CGI manner, the php.ini file is read during every web request, so you have more opportunity to use a different php.ini

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文