如何从我的 CPanel 访问 php.ini?
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/18495524/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
How to access the php.ini from my CPanel?
提问by Basel
I want to change the limit of the php POST array from 1000 to 6000 . Is there any way to do that ? i search about that and i found that i should change some variables in php.ini but the problem is that i did not find the directory of the file in my cpanel :
我想将 php POST 数组的限制从 1000 更改为 6000 。有没有办法做到这一点?我搜索了一下,发现我应该更改 php.ini 中的一些变量,但问题是我没有在我的 cpanel 中找到该文件的目录:
Your server's php.ini file is located at /usr/local/lib/php.ini.
This line is from the CPanel documentation but i could not find this directory in my cpanel even after i show the hidden files???? can anybody help me locating this file?
这一行来自 CPanel 文档,但即使在我显示隐藏文件后,我也无法在我的 cpanel 中找到这个目录????有人能帮我找到这个文件吗?
回答by Fosco Clayhangzo
Cpanel 60.0.26 (Latest Version) Php.ini moved under Software > Select PHP Version > Switch to Php Options > Change Value > save.
Cpanel 60.0.26(最新版本)Php.ini 移到软件 > 选择 PHP 版本 > 切换到 PHP 选项 > 更改值 > 保存。
回答by Dan Horrocks-Burgess
If you're on a shared hosting environment you won't have access to the php.ini to make these changes, if you need access, a virtual private server (VPS) or a dedicated server may be a better option if you're confident in managing it yourself.
如果您在共享主机环境中,您将无法访问 php.ini 来进行这些更改,如果您需要访问权限,虚拟专用服务器 (VPS) 或专用服务器可能是更好的选择,如果您是有信心自己管理。
Alternatively if you create a new file called .htaccess in your root of your web directory (Ensure it doesn't contain a .txt extension if using notepad to create the file) and copy something like this inside.
或者,如果您在 Web 目录的根目录中创建一个名为 .htaccess 的新文件(如果使用记事本创建文件,请确保它不包含 .txt 扩展名)并在其中复制类似的内容。
php_value settingToChange 6000
This will only work if your hosting provider let's you override the certain config value. Best to ask if it doesn't work after trying.
这仅在您的托管服务提供商让您覆盖特定配置值时才有效。最好在尝试后询问它是否不起作用。
回答by cmorrissey
You could try to find it via the command line.
您可以尝试通过命令行找到它。
find / -type f -name "php.ini"
Or you could add the following to a .htaccess
file in the root of your site.
或者您可以将以下内容添加到.htaccess
站点根目录中的文件中。
php_value max_input_vars 6000
php_value suhosin.get.max_vars 6000
php_value suhosin.post.max_vars 6000
php_value suhosin.request.max_vars 6000
回答by Arghadeeph Halder
In cPanel search for php, You will find "Select PHP version" under Software.
在 cPanel 中搜索 php,您会在“软件”下找到“选择 PHP 版本”。
Software -> Select PHP Version -> Switch to Php Options -> Change Value -> save.
软件 -> 选择 PHP 版本 -> 切换到 PHP 选项 -> 更改值 -> 保存。
回答by freeworlder
Go to main screen. Under 'Software/Services' > 'php.ini EZConfig'.
转到主屏幕。在“软件/服务”>“php.ini EZConfig”下。
回答by parveen
You cant do it on shared hosting , Add ticket to support of hosting for same ( otherwise you can look for dedicated server where you can manage anything )
您不能在共享主机上执行此操作,请添加支持相同主机的票证(否则您可以寻找可以管理任何内容的专用服务器)