php - Joomla 不读取自定义 php.ini

标签 php joomla php-ini

我在我的 public_html 文件夹中放置了一个自定义 php.ini 文件:

enter image description here

现在浏览example.com/phpinfo.php说新配置有效:

enter image description here

但是,Joomla 仍然没有使用新配置。当您转到 Joomla 的管理区域 > 站点 > 系统信息 > PHP 信息 时,它仍然显示 2M。

enter image description here

有什么想法吗?

最佳答案

此链接规定PHP信息页面上的第6个 block (如您的问题所示)显示Joomla安装所使用的php.ini的路径。

链接:http://forum.joomla.org/viewtopic.php?t=350630

Joomla 论坛帖子中的链接再次提到的一个好点是,如果您位于共享主机上,则通常无权访问 php.ini 文件。尽管如此,还是有人提到了这一点:

You can create php.ini at Joomla Directory. I do it usually.

也许你可以尝试这个替代方案?您的 public_html 文件夹是顶级 Joomla 安装文件夹吗?

编辑:有人提到他遇到了与您完全相同的问题(上传大小),这就是他所做的:

I found that my host said that the php.ini need to be where the script was ran. In this case for media manager it had a limit of 2mb. Reason for this was uploading large files Acrobat PDF I simply place a php.ini file into the administration folder of Joomla 1.5. Upon this PHP recognized the new php settings. Here are the php.ini file i created:

 register_globals = Off  
 upload_max_filesize = 30M  
 post_max_size = 30M 
 memory_limit = 30M  
 upload_tmp_dir = 30M  
 max_execution_time = 180

再次来自提供链接中的 Joomla 论坛帖子。您可以将 30M 替换为您需要的任何值。

关于php - Joomla 不读取自定义 php.ini,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/9584585/

相关文章:

javascript - responseText 不返回成功消息

php - 如何生成 Joomla 密码?

laravel - Mac OS X Mojave 需要 Mcrypt PHP 扩展

php - 在 Laravel Forge (Digital Ocean) 上扩展 max_execution_time

php - 使用 ini_set 设置 max_input_vars PHP.ini 指令

php - 使用 Laravel 5 热切加载多个索引关系

PHP 函数转义 MySQL 正则表达式语法

php - Laravel - 将文件上传到数据库

css - 如何在某些页面上隐藏 Bootstrap 列

php - 从 PHP 变量到 MySQL 的 NULL 日期值