我有一个linux服务器。我无法通过我的应用程序将图像上传到它。我检查了phpinfo(),发现upload_tmp_dir没有赋值。我觉得这是问题的原因。
我尝试编辑.htaccess但有人说这并不总是一个好方法。所以我尝试在我的服务器上搜索php.ini文件。令人惊讶的是,我找不到它。
那么,如果我在根文件夹中创建一个新的 php.ini 文件,这会影响我的服务器吗?
我只是担心如果所有 php.ini 覆盖我肯定会遇到大问题
那么我可以继续在我的新 php.ini 文件中添加此代码吗?
; 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/
更新:
它抛出这些警告
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