dongyou7292 2013-02-07 05:13
浏览 74

将创建新的php.ini将覆盖原始文件

I have a linux server. I am unable to upload images to it form my application. I checked phpinfo() in that i found upload_tmp_dir is assigned a no value. I feel this is the reason for the issue.

I tried editing .htaccess but some say it is not always a good method. So i tried searching for php.ini file on my server. Surprisingly i dint find it.

So, If i create a new php.ini file in root folder, will this effect my server?

I am just worrying if at all the php.ini overwrites i will definitely run into big problems

So can i proceed adding only this code in my new php.ini file ?

; Whether to allow HTTP file uploads.
file_uploads = On

; Temporary directory for HTTP uploaded files (will use system default if not
; specified).
;upload_tmp_dir = www/temp/uploads/

UPDATE:

It throws these warnings

PHP Warning:  move_uploaded_file(xml/xm.jpg.asp) [<a href='function.move-uploaded-file'>function.move-uploaded-file</a>]: failed to open stream: No such file or directory in /home/appsimon/public_html/api/update_xml.php on line 31
     PHP Warning:  move_uploaded_file() [<a href='function.move-uploaded-file'>function.move-uploaded-file</a>]: Unable to move '/tmp/phpLP5q96' to 'xml/xm.jpg.asp' in /home/appsimon/public_html/api/update_xml.php on line 31
     PHP Warning:  fopen(xml/xm.jpg.asp) [<a href='function.fopen'>function.fopen</a>]: failed to open stream: No such file or directory in /home/appsimon/public_html/api/update_xml.php on line 33
     PHP Warning:  file_get_contents(xml/xm.jpg.asp) [<a href='function.file-get-contents'>function.file-get-contents</a>]: failed to open stream: No such file or directory in /home/appsimon/public_html/api/update_xml.php on line 35
  • 写回答

2条回答 默认 最新

  • dsiv4041 2013-02-07 05:19
    关注

    Your problem has nothing to do with .htaccess file. .htaccess is basically processed by Apache but php.ini used by PHP compiler which is in fact an Apache module.

    If you do not have php.ini, maybe something went wrong with your PHP installation. Just grab a default php.ini and put it beside php.exe.

    You can also overwrite the functionality you want in the php.ini that you place in your root directory of web server not the root directory of Linux.

    评论

报告相同问题?

悬赏问题

  • ¥15 用hfss做微带贴片阵列天线的时候分析设置有问题
  • ¥15 基于52单片机的酒精浓度检测系统加继电器和sim800
  • ¥50 我撰写的python爬虫爬不了 要爬的网址有反爬机制
  • ¥15 Centos / PETSc / PETGEM
  • ¥15 centos7.9 IPv6端口telnet和端口监控问题
  • ¥120 计算机网络的新校区组网设计
  • ¥20 完全没有学习过GAN,看了CSDN的一篇文章,里面有代码但是完全不知道如何操作
  • ¥15 使用ue5插件narrative时如何切换关卡也保存叙事任务记录
  • ¥20 海浪数据 南海地区海况数据,波浪数据
  • ¥20 软件测试决策法疑问求解答