自定义 php.ini 文件在 VPS 托管中不起作用

发布于 2024-11-30 09:53:56 字数 484 浏览 2 评论 0原文

我尝试过网络解决方案技术支持,但没有解决问题(“您需要与签名支持联系,费用为 50 美元”)。 我正在使用 Net Sol VPS 帐户运行一些网站,并且需要更改 php 服务器的 upload_max_filesize 设置(默认情况下显然设置为微不足道的 2MB)。我已将: 添加

upload_max_filesize = 20M
post_max_size = 20M
max_execution_time = 6000

到 /httpdocs/cgi-bin/php.ini 文件(按照 NS 的说明),然后重新启动 apache,但是当我在该域上运行 phpinfo 时,不会应用这些设置。它仍然显示上传最大值为“2M”。

我也尝试将其添加到 /cgi-bin/php.ini 的服务器根目录中,但没有效果。

我看不到 /cgi-bin/.php/php.coalesced.ini 文件。

有什么想法吗?我对此失去了理智。

I've tried going through Network Solutions tech support but didn't get it resolved ("You need to talk to Signature Support, which is $50").
I'm running some sites off of a Net Sol VPS account and need to change the upload_max_filesize setting (which is apparently set to a paltry 2MB by default) for the php server. I've added:

upload_max_filesize = 20M
post_max_size = 20M
max_execution_time = 6000

to the /httpdocs/cgi-bin/php.ini file (per NS's instructions), and then restarted apache, but when I run a phpinfo on that domain, the settings are not applied. It still says "2M" for the upload max.

I also tried adding this to the server root at /cgi-bin/php.ini as well, to no effect.

There is no /cgi-bin/.php/php.coalesced.ini file that I can see.

Any ideas? I'm losing my mind with this.

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

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

发布评论

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

评论(3

岁月染过的梦 2024-12-07 09:53:56

首先想到的是检查 phpinfo() 输出中“加载的配置文件”设置中列出的值,并确保它与您正在编辑的文件匹配。

First thought is to check your phpinfo() output for the value listed in the "Loaded Configuration File" setting and make sure that it matches the file you've been editing.

独留℉清风醉 2024-12-07 09:53:56

您不能只是乱扔 PHP.ini 文件并期望 PHP 加载它们。如果没有被告知在 cgi-bin 目录中查找文件,该文件将被忽略。

检查 phpinfo() 输出 - 第一部分将准确告诉您定位/解析了哪些 .ini 文件及其位置。例如,在我的家庭服务器上:

Configuration File (php.ini) Path   /etc/php5/apache2
Loaded Configuration File   /etc/php5/apache2/php.ini
Scan this dir for additional .ini files     /etc/php5/apache2/conf.d
Additional .ini files parsed    /etc/php5/apache2/conf.d/curl.ini, /etc/php5/apache2/conf.d/gmp.ini, /etc/php5/apache2/conf.d/mysql.ini, /etc/php5/apache2/conf.d/mysqli.ini, /etc/php5/apache2/conf.d/pdo.ini, /etc/php5/apache2/conf.d/pdo_mysql.ini 

如果您的 cgi-bin .ini 文件未列出,则 PHP 不会在该目录中查找。

You can't just litter PHP.ini files around and expect PHP to load them. If it's not been told to look for one in that cgi-bin directory, the file will just get ignored.

Check the phpinfo() output - the first section will tell you exactly what .ini files were located/parsed, and their location. e.g. on my home server:

Configuration File (php.ini) Path   /etc/php5/apache2
Loaded Configuration File   /etc/php5/apache2/php.ini
Scan this dir for additional .ini files     /etc/php5/apache2/conf.d
Additional .ini files parsed    /etc/php5/apache2/conf.d/curl.ini, /etc/php5/apache2/conf.d/gmp.ini, /etc/php5/apache2/conf.d/mysql.ini, /etc/php5/apache2/conf.d/mysqli.ini, /etc/php5/apache2/conf.d/pdo.ini, /etc/php5/apache2/conf.d/pdo_mysql.ini 

if your cgi-bin .ini file isn't listed, then PHP is NOT looking in that directory.

一向肩并 2024-12-07 09:53:56

我知道这已经很旧了,但我想我会分享我的经验。我尝试按照我读到的建议将 php.ini 文件添加到 /cgi-bin 文件夹中,但这似乎不起作用。我的解决方案是通过 SSH 连接到服务器并更改真实的 php.ini 文件,然后重新启动服务器。

I know this is old but figured I'd share my experience. I tried adding a php.ini file to the /cgi-bin folder as I read was suggested, that didn't appear to work. My solution was to SSH onto the server and make a change to the real php.ini file and then restarting the server.

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