File Center Error?

Use GitHub to post bug reports and error descriptions for phpwcms. Describe your problem detailed!
Locked
hrhansen
Posts: 7
Joined: Wed 5. Nov 2003, 11:10
Location: Copenhagen, Denmark

File Center Error?

Post by hrhansen »

Hi,

I have just installed your wonderful script, and is eager to get my first phpwcms site up and running. However, when trying to upload a picture into a folder in my "private files" section, the system returns this error:

"Error while creating user directory. Please do not try again - this is an server error! Contact the webmaster to tell as soon as possible!"

Suppose I'm the webmaster here? I've got no clue whatsoever as to what is causing this error - hope you guys can figure it out for me :)

I have taken the desperate measure and CHMODed all of my folders to "777" just to make sure that the script can "access all areas". This did NOT solve my problem.

Anyone?

Kind regards

Stig Moeller Hansen
Copenhagen, Denmark

User avatar
Oliver Georgi
Site Admin
Posts: 9654
Joined: Fri 3. Oct 2003, 22:22
Location: Moscow, Russia
Contact:

Post by Oliver Georgi »

Like the error message say: the system can not create the user directory where all files of this user are will be stored. This will be done in the phpwcms_filestorage. If you can create the directory yourself. It must named like the user's ID - maybe if you are the first user it is "1". Do you have PHP running in SAFE_MODE?

Maybe the owner of phpwcms_filestorage is root and not the webserver.

Oliver
Oliver Georgi | phpwcms Developer | GitHub | LinkedIn | Систрон

hrhansen
Posts: 7
Joined: Wed 5. Nov 2003, 11:10
Location: Copenhagen, Denmark

Post by hrhansen »

Hi Oliver,

Checked my hosting providers PHP config, and it seems like their version of PHP is running in SAFE_MODE. Nothing I can do about it. Darn!

Isn't there something I can do to trick phpwcms into running even though SAFE_MODE is enabled?

Checked my phpwcms directory via FTP. A folder labeled "1" has indeed been created automatically, and a quick check with CHMOD returns "777" - so no problem here.

I'm not really sure what you mean by "owner"? Do I need to change something in my configuration?

Thank you for a very quick response.

User avatar
Oliver Georgi
Site Admin
Posts: 9654
Joined: Fri 3. Oct 2003, 22:22
Location: Moscow, Russia
Contact:

Post by Oliver Georgi »

In phpwcms_filestorage make (if possible) a "list -l". Maybe this shows you the user/usergroup of the created directory.

Have you tried uploading again?

Oliver
Oliver Georgi | phpwcms Developer | GitHub | LinkedIn | Систрон

hrhansen
Posts: 7
Joined: Wed 5. Nov 2003, 11:10
Location: Copenhagen, Denmark

Post by hrhansen »

User: www
Group: 80

Good? Bad?

Tried uploading again. Same error.

Stig

User avatar
Oliver Georgi
Site Admin
Posts: 9654
Joined: Fri 3. Oct 2003, 22:22
Location: Moscow, Russia
Contact:

Post by Oliver Georgi »

Have you tried the ftp takeover upload possibility?

What is the user/group setting of all other folders in your account: also www/80?
Oliver Georgi | phpwcms Developer | GitHub | LinkedIn | Систрон

hrhansen
Posts: 7
Joined: Wed 5. Nov 2003, 11:10
Location: Copenhagen, Denmark

Post by hrhansen »

Haven't tried the FTP takeover feature yet. Might give it a shot right away.

Only the automatically generated folder "1" has www/80 as user/group.

Every other folder my phpwcms installation has daddycooldk/daddycooldk as user/group. "daddycooldk" being the name of my account at my hosting provider.

Puzzles me...

User avatar
Oliver Georgi
Site Admin
Posts: 9654
Joined: Fri 3. Oct 2003, 22:22
Location: Moscow, Russia
Contact:

Post by Oliver Georgi »

Maybe the www/80 is a problem. I don't know.

Try to change the owner of "1": "chown -R daddycooldk.daddycooldk"

Maybe there is another problem with files.

Oliver
Oliver Georgi | phpwcms Developer | GitHub | LinkedIn | Систрон

User avatar
Oliver Georgi
Site Admin
Posts: 9654
Joined: Fri 3. Oct 2003, 22:22
Location: Moscow, Russia
Contact:

Post by Oliver Georgi »

I will test this:

""
If you are running with safe_mode on, your scripts whose uid's are not 0 will not be able to access uploaded files from the directory designated by upload_tmp_dir, because as the file is written to the directory it appears to take on the ownership from that directory.

You must take care to set the correct ownership of the upload_tmp_dir when operating in safe-mode. If you use Apache and PHP as a module, you can set upload_tmp_dir to /tmp/php for example and then chown the directory /tmp/php to the user Apache runs under. Then make the directory read&writable.

If your scripts are running under a different user as Apache, you have to set the upload_tmp_dir owner to THIS user, not to the user Apache runs under.

If you have many scripts and they run under different owners in safe_mode, you have to set up a temp-dir for each of these users.

One proposed solution is: Set upload_tmp_dir in your php.ini file/Apache config, to be "./tmp/". This causes any uploaded files to be written to the tmp subdirectory from the same directory as the script was executed from.

Another solution is to control PHP:s behaviour through the use of .HTACCESS files.
**
Oliver Georgi | phpwcms Developer | GitHub | LinkedIn | Систрон

User avatar
Oliver Georgi
Site Admin
Posts: 9654
Joined: Fri 3. Oct 2003, 22:22
Location: Moscow, Russia
Contact:

Post by Oliver Georgi »

SAFE_MODE problems


OK here is a little solution:

1) look what user/group the new created directory in phpwcms_filestorage has

2) look for your "open_basedir". This must set to the user/group of the directory that phpwcms has created when you have tried to upload a file. The phpwcms_ftp directory must set to the same user/group.

3) set all directories (1, 2, 3...) inside phpwcms_filestorage to the user/group that these have which you have uploaded via FTP.

This helps in a way that you can upload files via webbrowser and ftp for ftp takeover. You will need a "safe_mode_exec_dir" to start ImageMagick.


But maybe this helps you start working with phpwcms. You can use images with replacement tags.

Oliver
Oliver Georgi | phpwcms Developer | GitHub | LinkedIn | Систрон

hrhansen
Posts: 7
Joined: Wed 5. Nov 2003, 11:10
Location: Copenhagen, Denmark

Thank you

Post by hrhansen »

Thank you very much for your hard efforts. I sure hope it'll solve my problems. I'll give it a shot and let you know how things turn out.

Kind regards

Stig

Locked