4images Forum & Community

4images Issues / Ausgaben => Discussion & Troubleshooting => Topic started by: shadow600 on September 10, 2002, 09:12:00 PM

Title: safe mode
Post by: shadow600 on September 10, 2002, 09:12:00 PM
Hi,
ich folgendes Problem. Wenn ich Bilder hochlade und nachträglich die Thumbnails erstellen will, bekomme ich immer folgende Fehlermeldung:

Warning: SAFE MODE Restriction in effect. The script whose uid is 1038 is not allowed to access ./../data/media/1/018_2.jpg owned by uid 30

Dann gehe ich immer per FTP auf den Server (pureserver) und lösche den File und spiele die unter dem chmod 777 wieder drauf. Nur, das geht momentan noch, wenn es auch andere User gibt, ist das nicht mehr möglich.

Was kann ich machen???

Gruß Jörg
Title: safe mode
Post by: Jan on September 10, 2002, 09:20:18 PM
Einige User hatten hier gepostet, dass es geht wenn man die Kategorie-Ordner von Hand erstellt und mit 777 chmoded.

Jan
Title: safe mode
Post by: shadow600 on September 11, 2002, 08:18:23 AM
Das hatte ich gemacht. Also der Ordner und Unterordner sind per Hand auf 777 gesetzt. Ich will mal den Provider fragen, ob man nicht den Safe Mode abschalten kann. Außerdem muß ich mich mal erkundigen, was das überhaupt ist.
Vielleicht kann man es dann umgehen. Ich hatte erst nachdem ich gepostet hatt gesehen, daß mehrere auch mein Problem haben.

Gruß Jörg
Title: Warning: SAFE MODE Restriction in effect.
Post by: Dmitro on September 20, 2002, 02:36:17 PM
Hi,

Sorry, I have the same problem. It happened suddenly. I don't know the reason. I did not change anything in my program since a few days, and it was perfectly OK till now.
Please, could you explain what happened it in English?

The WARNING messages as follows:

Warning: SAFE MODE Restriction in effect. The script whose uid is 33073 is not allowed to access ./data/media/117/P1010059.jpg owned by uid 99 in /home/violadab/public_html/violin.pictures/includes/functions.php on line 107

Warning: SAFE MODE Restriction in effect. The script whose uid is 33073 is not allowed to access ./data/thumbnails/117/P1010059.jpg owned by uid 99 in /home/violadab/public_html/violin.pictures/includes/functions.php on line 107

Warning: SAFE MODE Restriction in effect. The script whose uid is 33073 is not allowed to access ./data/thumbnails/117/P1010059.jpg owned by uid 99 in /home/violadab/public_html/violin.pictures/includes/functions.php on line 107

With many thanks,
Dmitry
Title: safe mode
Post by: Jan on September 20, 2002, 02:59:19 PM
You have enabled safe_mode in your php.ini. Disable it or aks your host if he can do it for you.

Jan
Title: Host
Post by: Dmitro on September 20, 2002, 03:03:49 PM
Thanks, Jan for your ever fast response.
I just sent a complaint to my host. I hope they will answer  - they usually don't reply so readily.
Dmitry
Title: Host response
Post by: Dmitro on September 20, 2002, 03:17:48 PM
Jan, my host replied:

Yes due to certain security issue php has been set to safe mode. It will not run under null or null user, you will need to use your username now.

Is it very bad news?
Dmitry
Title: safe mode
Post by: Jan on September 20, 2002, 04:21:02 PM
Yes, of course. First, you should update to the newest version of 4images.
Some users reported that creating the cat folders by ftp will allow you to upload images and use the Auto-Thumbnailer while safe_mode is enabled.

Jan
Title: safe_mode
Post by: Dmitro on September 20, 2002, 04:35:22 PM
Dear Jan,
Thanks. I will first try to resolve that issue with my host.
I was reluctant to upgrade because I've done quite a lot of customization, and it was working really fine till now.
Dmitry
Title: safe mode
Post by: Dmitro on September 20, 2002, 05:08:59 PM
Dear Jan,

I got that reply from my host:

"php.ini is enabled with
safe mode so your code needs to be able to
run under the user."

So, if I upgrade, this problem would be partially solved?

Dmitry
Title: safe mode
Post by: Jan on September 20, 2002, 05:26:59 PM
No, the problem is safe_mode, not the script. I think you should first change the code in functions.php, line 107.

I guess there is the function getimagesize(). Put a @ before the function name:
Code: [Select]
@getimagesize
This will supress the error message and you can run your site for the first time.

The problem will be that you can't use the Auto-Thumbnailer and maybe the folder creation while adding categories will fail. Only way is, to create these folders by hand.

Jan
Title: getimagesize()
Post by: Dmitro on September 20, 2002, 06:02:45 PM
Jan,
There is no getimagesize() on line 107 in includes/functions.php
(I have version 1.6)
Dmitry
Title: Host reply
Post by: Dmitro on September 20, 2002, 09:44:44 PM
Dear Jan,
I have been on the wire with the host whole day.
Here is what the host's developer wrote:

Here's part of the problem.

The files in Media/117 is not owned by your account.
They are owned by 99

Let me show you a (unix command) ls -la

-rw-rw-rw- 1 99 99 51435 Aug 26 18:41 P1010003.jpg
-rw-rw-rw- 1 99 99 48283 Aug 26 19:14 P1010014.jpg
-rw-rw-rw- 1 99 99 61438 Sep 7 14:47 P1010021.jpg
-rw-rw-rw- 1 99 99 61438 Sep 8 16:47 P1010021_2.jpg
-rw-rw-rw- 1 99 99 16647 Sep 3 14:05 P1010059.jpg
-rw-rw-rw- 1 99 99 47874 Sep 3 14:08 P1010060.jpg

Now I've seen that to happen because your visitors are uploading their images.

The main source of this is your upload script (correct me if i'm wrong) is
not configured to upload the images from your website as your user.

Since safe_mode will not let your run anything that isn't owned by you, you'll
get that problem.

Where did you get this script?

Does it give you any idea?
Dmitry
Title: safe mode
Post by: Nicky on September 20, 2002, 10:56:29 PM
hi,

i don't know where you hosting your site, but your server admin should know that every php upload process over a webbrowser will upload files as webserver user and not as your userid
example
Quote

-rw-rw-rw- 1 wwwrun www 51435 Aug 26 18:41 P1010003.jpg

or in your case
Quote

-rw-rw-rw- 1 99 99 51435 Aug 26 18:41 P1010003.jpg


well, what he can do for you:
he should go with his SSH client to your data folder and do following
Quote
linux:/home/account/4images/data # chown -R YOURUSERID:YOURGROUP *


OR

you have to download all data folders (including pics of course) to your pc.
delete the folders and images on your server..
then upload the folders again to the server...
BUT do that just where is the owner/group 99

hope this will help...
Title: safe mode
Post by: Dmitro on September 20, 2002, 11:00:06 PM
Dear Nicki,
Thanks for a comprehensive reply. I will send your comm to the host (in USA). Let's see if it will help.
Best regards,
Dmitry
P.S. Thanks and congratulations for the great program!
Title: safe mode
Post by: Dmitro on September 21, 2002, 09:44:41 AM
Nicky, Jan,
I send your comments to my host. They seem to have turned the safe mode OFF for my domain. My work is be back to normal. Hope it stays this way.
Many thanks. I appreciate your help very much.
Dmitry
Title: safe mode
Post by: Nicky on September 21, 2002, 10:01:23 AM
just make a file phpinfo.php with content
Code: [Select]

<? phpinfo() ?>

to see if SAFE MODE really turned off...

if server admin just executed
Code: [Select]

chown -R xxx

you will run into troubles again, after webbrowser upload..
Title: safe mode
Post by: Dmitro on September 21, 2002, 10:13:10 AM
My phpinfo said:

Thread Safety: disabled
Does it stand for safe_mode off?

I send you a comlete table here:

System                    | Linux host04.ipowerweb.com 2.4.7-10smp #1 SMP Thu Sep 6 17:09:31 EDT 2001 i686 unknown
Build Date                | Sep 19 2002 18:08:30
Configure Command | './configure' '--with-apxs=/usr/local/apache/bin/apxs' '--with-xml' '--enable-bcmath' '--enable-calendar' '--enable-ftp' '--with-gd=../gd-1.8.4' '--with-jpeg-dir=/usr/local' '--with-png-dir=/usr' '--with-imap=../imap-2001.BETA.SNAP-0105220031' '--with-mcrypt' '--with-ming=../ming-0.1.1' '--enable-magic-quotes' '--with-mysql' '--with-pear' '--enable-safe-mode' '--enable-sockets' '--enable-track-vars' '--with-ttf' '--enable-versioning' '--with-zlib'

server API               | Apache
Virtual directory       | Support disabled
Configuration File     |
(php.ini) Path           | /usr/local/lib/php.ini
Debug Build             | no
Thread Safety          | disabled

Dmitry
Title: safe mode
Post by: Nicky on September 21, 2002, 10:14:57 AM
just send me the url to phpinfo.php
i will look on it..
Title: safe mode
Post by: Dmitro on September 21, 2002, 10:17:02 AM
http://www.violadabraccio.com
Title: safe mode
Post by: Dmitro on September 21, 2002, 10:22:59 AM
Quote from: Dmitro
http://www.violadabraccio.com


I just checked web-browser upload. It seems to work as normally.
Title: safe mode
Post by: Nicky on September 21, 2002, 10:24:18 AM
you should be a happy men:
safe_mode: Local Value: Off  Master Value: Off
let's rock !
have phun....

dasvidanija
Title: safe mode
Post by: Dmitro on September 21, 2002, 02:31:27 PM
Dear Nicky,
Spasibo!  :D
The host apologized.
Title: safe mode
Post by: Nicky on September 21, 2002, 02:35:29 PM
ocen harasho ;)

you're welcome ....
great that they turned it off..