简体   繁体   English

php.ini影响所有子文件夹

[英]php.ini to affect all sub-folders

I need to add a php.ini in a specific folder in my server to set allow_url_fopen = true for a website. 我需要在服务器的特定文件夹中添加php.ini,以为网站设置allow_url_fopen = true The website has its root folder an plenty of sub-folders that also have many sub-folders. 该网站的根文件夹中包含许多子文件夹,也有许多子文件夹。

If I place the php.ini in the root of the website, it seems to only affect that folder (I've run phpconfig() there and in the subfolders. 如果我将php.ini放置在网站的根目录中,则似乎只影响该文件夹(我在该文件夹及其子文件夹中运行phpconfig())。

Is it possible to make it somehow that affects all the subfolders without having to palce uno php.ini per sub-folder? 是否有可能使它以某种方式影响所有子文件夹,而不必在每个子文件夹中放置php.ini?

Regarding Mario's comment, I tried both php.ini and .user.ini . 关于Mario的评论,我尝试了php.ini.user.ini As he said php.ini is not recursive, but .user.ini is working recursively for me. 正如他所说, php.ini不是递归的,但是.user.ini正在为我递归工作。 I am also on 1and1 shared linux hosting with PHP5 as well. 我也使用PHP5在1and1共享Linux托管上。 I just put the .user.ini in my root directory. 我只是将.user.ini放在我的根目录中。

您可以在.htaccess中设置PHP配置选项。

php_flag allow_url_fopen on

暂无
暂无

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

相关问题 如何让我的 php.ini 文件影响我服务器的所有目录/子目录? - How do I enable my php.ini file to affect all directories/sub-directories of my server? PHP 命名空间问题与子文件夹有关 - PHP namespaces issue with sub-folders 自定义php.ini文件被认为是错误的,为什么? 在根目录或根目录的子文件夹中使用自定义php.ini文件时,会出现什么问题? - Custom php.ini files are considered as bad, why ? What problems does appear when using custom php.ini files in root or in sub folders of root? 如何删除所有子文件夹中的所有文件,除了那些文件名为'whatever.jpg'的PHP文件? - How to delete all files in all sub-folders except those whose filename is 'whatever.jpg' in PHP? PHP.ini文件更改未生效(内存限制) - PHP.ini File changes not taken affect (memory limit) 增加了PHP.ini内存限制,没有任何影响 - Increased the PHP.ini memory Limit without any affect 单个PHP文件,可以擦除包含子文件夹和文件本身的文件夹中的所有内容 - Single PHP file that can erase all the contents inside a folder with sub-folders included and the file itself PHP - 使用 sftp 从根文件夹和子文件夹下载所有文件 - PHP - Download all files from the root and sub-folders using sftp 我可以在Linux(Debian)中为单个文件夹设置php.ini吗? - Can I set php.ini for individual folders in Linux (Debian)? 如何遍历所有带有特殊文件的子文件夹? - How to traverse all sub-folders with special file in it?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM