将创建新的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

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.

Usually, it overrides the php.ini on the server. You can only specify some of the values in your new php.ini. Only the specified values get over-ridden.

You can also use PHP for overriding some of the php.ini values (only if your hosting provider allows this.)