donglei1973 2014-12-22 11:28
浏览 39
已采纳

ini_set没有在php.ini中设置值

I'm trying to set a new directory for upload_tmp_dir and set a new upload_max_filesize but it's not working... I'm displaying the results but I'm getting the old (default php.ini settings) back...

ini_set('upload_tmp_dir','/');
ini_set('upload_max_filesize','1024M');

And now let's display the results :

echo 'Your Temp Upload Directory : '.ini_get('upload_tmp_dir').'<br>';
echo 'Your Upload Max Filesize : '.ini_get('upload_max_filesize').'<br>';

The original php.ini default settings is displayed to the screen and not my new settings.

What could possibly be the reason ?

  • 写回答

2条回答 默认 最新

  • dopmgo4707 2014-12-22 11:45
    关注

    Not all php.ini values can be overriden by php_ini() function. Full list could be found here. And changable values could be found here.

    Basicly You cannt override these two values in php file.

    upload_tmp_dir can be set only in php.ini file and upload_max_filesize can be set in php.ini, .htaccess, httpd.conf or .user.ini files.

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(1条)

报告相同问题?

悬赏问题

  • ¥100 set_link_state
  • ¥15 虚幻5 UE美术毛发渲染
  • ¥15 CVRP 图论 物流运输优化
  • ¥15 Tableau online 嵌入ppt失败
  • ¥100 支付宝网页转账系统不识别账号
  • ¥15 基于单片机的靶位控制系统
  • ¥15 真我手机蓝牙传输进度消息被关闭了,怎么打开?(关键词-消息通知)
  • ¥15 装 pytorch 的时候出了好多问题,遇到这种情况怎么处理?
  • ¥20 IOS游览器某宝手机网页版自动立即购买JavaScript脚本
  • ¥15 手机接入宽带网线,如何释放宽带全部速度