简体   繁体   English

编辑php.ini

[英]Editing php.ini

How do I edit php.ini when my host doesn't give me access to the core file? 当我的主机不给我访问核心文件的权限时,如何编辑php.ini? Is there a way to create a "sub" php.ini? 有没有办法创建一个“子” php.ini? If so, how would I make my apps pick up the subsequent file and use that instead of the master file (that I don't have access to edit)? 如果是这样,我将如何使我的应用程序拾取后续文件并使用该文件而不是主文件(我无权进行编辑)? It's a typical shared web host if that matters. 如果重要的话,它是典型的共享Web主机。

http://www.php.net/manual/en/configuration.changes.php http://www.php.net/manual/zh/configuration.changes.php

If your host allows it, you can use an Apache directive in an .htaccess file to override the INI path. 如果主机允许,则可以在.htaccess文件中使用Apache指令来覆盖INI路径。 (Most shared hosts, however, don't allow this.) (但是,大多数共享主机不允许这样做。)

You might also be able to change certain individual settings via the ini_set() function in your script - again, if your host allows it. 您也可以通过脚本中的ini_set()函数更改某些单独的设置-如果您的主机允许,也可以再次更改。

尝试使用内置函数ini_set()

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM