Jump to content

Windows/IIS Server Install & File/Image Upload Fix


Recommended Posts

I liked the system... I installed it on my Windows 2003 Enterprise Server running IIS6 and ISPAI version of PHP5.2.8 (the CGI version doesn't work well on all machines... especially fast machines)... and as with everybody else, I was unable to upload images or change the logo or the FAVICON, etc. I hunted all over the forum and the net and could not find a decent answer. A lot of people venturing a lot of crap, but nothing geared towards us users that, even though we may hate Microsoft, prefer IIS over Apache.

Anyway... I went to where I should have gone in the first place... the Getting Started page at the PrestaShop WiKi. And I found this interesting section:

While you have your FTP connected to your Web hosting server, make sure the following PrestaShop folders have ‘write’ permissions (also known as “CHMOD 777” – explanation of file permissions here) but do not apply these permissions recursively (to their subfolders):
• /config
• /upload
• /download
• /tools/smarty/compile

Then make sure the following folders have ‘write’ permissions and apply these permissions recursively (to their subfolders):
• /img
• /mails
• /modules
• /themes/prestashop/lang
• /translations

Basically what this means for us Windows/IIS users is that we have to give the anonymous IIS user and IIS process accounts (usually called IUSR_machinename and IWAM_machinename respectively) write (and ideally modify) access to the folders listed above.

NOTE: If at this point you don't know what I am talking about, you probably do not manage your own server (you only have a windows-based hosting account) or you should probably get someone with the know-how to take care of it for you cause you shouldn't be managing your server in the first place.


Anyway... to continue... this doesn't fix the problem with the image uploads... but it did fix the problem with the FAVICON which led me to realize exactly what the problem was with the image uploads... and here is where it get's really complicated for people who do not manage their own server and poses a security problem with people who have the knowledge and (most importantly) the desire hack your site. You must give the two accounts I mentioned before (IUSR_machinename and IWAM_machinename) WRITE and MODIFY access to the php temp folder which in most cases is drive:\\temp (C:\Windows\Temp). This completely fixes the problem.

Good luck with getting a hosting company to do that for you. And if you manage your own server... make sure your security is top notch!
Link to comment
Share on other sites

  • 2 weeks later...

did solved my problem, but i made a new directory for temp in my wwwroot and changed the temp directory in php ini so that i didnt have to award the rights for the internet user to my windows dir for security reasons.


thank you for the solution.

wvdbroek

Link to comment
Share on other sites

  • 1 month later...

I just read your post and I am running IIs on my own server. I have posted several questions related to exactly what you were talking about. I will try your fix in a day or so and let you guys know how it worked. Thanks for the new ideas to try. Paul-RR

Link to comment
Share on other sites

I am happy it solved the problem for you too. And changing the PHP temp directory is the best thing you could do... it's exactly what I did afterwards too. Thank you for posting, I was beginning to think I was the only Windows/IIS user out there :D.



If you don't mind exactly what is the setting in the PHP.ini file to change the temp directory?

Thanks

Paul-rr
Link to comment
Share on other sites

in the php.ini you should change the path of the temp dir to the new path of the temp dir you created in your wwwroot directory.

And give write / modify acces to the inetuser for that dir.

I did the above but it did not solve my image upload issue.

Link to comment
Share on other sites

in the php.ini you should change the path of the temp dir to the new path of the temp dir you created in your wwwroot directory.

And give write / modify acces to the inetuser for that dir.

I did the above but it did not solve my image upload issue.


There are several tmp directories referred to in the PHP.ini file. Could you give me a copy of the line?

Thanks

Paul-rr
Link to comment
Share on other sites

[quote

There are several tmp directories referred to in the PHP.ini file. Could you give me a copy of the line?

Thanks

Paul-rr

Look for the temp dir in the ini file.
There where it has a path next to it. You change the path there to the new temp dir in the wwwroot directroy.

Then restart IIS

Link to comment
Share on other sites

It looks like the problem that we are all having is that the php script tried to write to the img/tmp files with owner is nobody.
-if it is allowed to write as nobody, you see alot of files stuck in the /img/tmp and they cant be processed to generate images from them in img/p
-if it is not allowed to write as nobody (which is in my case) nothing get written and nothing that i find in the logs.

How can we make the php import to not write them as nobody but to write them as user?

Link to comment
Share on other sites

It looks like the problem that we are all having is that the php script tried to write to the img/tmp files with owner is nobody.
-if it is allowed to write as nobody, you see alot of files stuck in the /img/tmp and they cant be processed to generate images from them in img/p
-if it is not allowed to write as nobody (which is in my case) nothing get written and nothing that i find in the logs.

How can we make the php import to not write them as nobody but to write them as user?


What web server are you usiing?

Paul-RR
Link to comment
Share on other sites

it is a linux with apache


Sorry I am running Windows & IIs. But in IIs it is not necessary to be the owner of the file just to have access to it for Read, Write and Change etc for the anonymous web user.

Sorry not much help for Linux or Apache.

Paul-RR :zip:
Link to comment
Share on other sites

hehe that is why I dont use windows


Well, if you write something for Windows (PS) it would run on everything else. Write for one of the Wannabees its lucky to run only on that one Wannabee. :cheese:
Just think how nice it would be if the developers, developed on a real web server, then it would run on everything. It is really hard to beat the keeper of keys.
Link to comment
Share on other sites

  • 2 months later...

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...