aLieNzDaToR Posted August 22, 2011 Share Posted August 22, 2011 I have a PHP web system that store in a windows server. In the system, there is a function for user to upload files to another server (Shared server in Unix). When i try to upload a file, it gives warning: Warning: move_uploaded_file(\\unixserver/sharedfolder/upload/test.txt) [function.move-uploaded-file]: failed to open stream: Permission denied in C:\wamp\www\upload\index.php on line 40 For your information, my username has been assigned in xxx's group that has access to read and write on that folder. Besides, i'm able to open,create and delete files on that folder's server manually (samba). The safe mode setting is off. Does anybody has any idea why this thing happen? Quote Link to comment https://forums.phpfreaks.com/topic/245408-problem-uploading-file-from-windows-server-to-unix-server-permission-denied/ Share on other sites More sharing options...
trq Posted August 22, 2011 Share Posted August 22, 2011 Your server needs permission to move files, not you. Quote Link to comment https://forums.phpfreaks.com/topic/245408-problem-uploading-file-from-windows-server-to-unix-server-permission-denied/#findComment-1260416 Share on other sites More sharing options...
aLieNzDaToR Posted August 23, 2011 Author Share Posted August 23, 2011 You mean, i need to add permission for apache that allow to read and write access to that shared server? What is apache username and group? Where could i check this information? Thanks for the reply Quote Link to comment https://forums.phpfreaks.com/topic/245408-problem-uploading-file-from-windows-server-to-unix-server-permission-denied/#findComment-1260737 Share on other sites More sharing options...
trq Posted August 23, 2011 Share Posted August 23, 2011 Yes. You can check it by using: grep User /etc/apache2/httpd.conf && grep Group /etc/apache2/httpd.conf Your config file location may differ. Quote Link to comment https://forums.phpfreaks.com/topic/245408-problem-uploading-file-from-windows-server-to-unix-server-permission-denied/#findComment-1260768 Share on other sites More sharing options...
aLieNzDaToR Posted August 25, 2011 Author Share Posted August 25, 2011 I assume, that is the setting in the httpd.conf file. I already change the setting to user and group that has access to the shared server like this (part of httpd.conf file): <IfModule !mpm_netware_module> <IfModule !mpm_winnt_module> # # If you wish httpd to run as a different user or group, you must run # httpd as root initially and it will switch. # # User/Group: The name (or #number) of the user/group to run httpd as. # It is usually good practice to create a dedicated user and group for # running httpd, as with most system services. # User MY-USERNAME Group MY-GROUP </IfModule> </IfModule> But, it still gives me the same error on the permission. What else that could be the cause of the error? Quote Link to comment https://forums.phpfreaks.com/topic/245408-problem-uploading-file-from-windows-server-to-unix-server-permission-denied/#findComment-1261681 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.