PDA

View Full Version : Turning Safe Mode off - where is php.ini?


devenh
2nd of October 2004 (Sat), 08:34
I want to turn Safe Mode off and searched the forums on how to do this. What I found was that Safe Mode was set in php.ini, but I can't find this file. Help!

Deven

tommykjensen
2nd of October 2004 (Sat), 08:39
You can only change that if You are running Your own server.

If You run ee on a host then it bad luck because the hoster is probably not inclined to change that setting.

If You are running You own server then php.ini is in c:\winnt on windows. On *nix I don't remember where it is.

devenh
2nd of October 2004 (Sat), 09:52
I checked with my ISP and they confirm that PHP Safe Mode is Off, but EE reports:

betanote: safe mode is on

So I'm confused -- is EE running under Safe Mode On or not?

Deven

ktpupp
4th of October 2004 (Mon), 10:59
I am having this same problem, my phpinfo.php reports that safe mode is off, but I have the notice "betanote: safe mode is on" in EE...

My gallery is set up at http://www.sumbler.com/images/ with two pics in it, but they are huge since ImageMagick isn't working and creating thumbs, microthumbs or anything smaller than full size images.

I get this message when uploading/resizing:
IMAGEMAGICK ERROR:

POSSIBLE REASONS:
SAFE MODE ON? EE can not use ImageMagick when is it located outside PHP safe mode exec dir.
IMAGE IS EMPTY? Perhaps source image was zero size.
IMAGEMAGICK PATH CHANGED? Maybe your server admin has moved IM to another location.
FOLDER PERMISSIONS WRONG? check that UPLOAD folder and all folders inside it are chmod 0777 (full permissions)

I'm sure the problem is this safe mode issue...

Help?!?!!?

-=kt=- :?

Pekka
4th of October 2004 (Mon), 14:34
There are two safe mode settings in PHP, "Local Value" and "Master Value". Master is applied to whole server, local to virtual site. Those values can be seen in phpinfo.

You can usually change local value in .htaccess file - don't have details here now but they are there in http://www.php.net website for sure.

ktpupp, what does you graphics modules editor say when you do imagemagick test?

devenh
4th of October 2004 (Mon), 15:23
Could be a bug in the EE code that incorrectly reports the state of safe mode:


<?php
//
// EE code
//
print "<br>PHP maxtime: " . ini_get('max_execution_time');
$val = ini_get("safe_mode");
if ($val == "") $safe_mode = "on";
if ($val != "") $safe_mode = "off";
print "<p>betanote: safe mode is {$safe_mode} {$val}<br>";
//
// My test code
//
if (ini_get("safe_mode")) print "<p>safe mode is on<br>";
if (!ini_get("safe_mode")) print "<p>safe mode is off<br>";
?>


When I run this on my server, the EE code reports safe code as on, while my mode reports it as off.

Deven

ktpupp
4th of October 2004 (Mon), 16:13
There are two safe mode settings in PHP, "Local Value" and "Master Value". Master is applied to whole server, local to virtual site. Those values can be seen in phpinfo.

You can usually change local value in .htaccess file - don't have details here now but they are there in http://www.php.net website for sure.

ktpupp, what does you graphics modules editor say when you do imagemagick test?

When I run the test, I get the little elk image showing up and the button to click to tell EE that I saw the image and ImageMagick is working:

http://www.sumbler.com/images/EE_IM_test.jpg

Below this image the paths for IM both read PATH OK in green, too.

IM just seems to fail when I am adding pictures from the "Upload to Database" section... :(

Thanks for any help! I'll look for info the Master and Local Safe Mode settings for my PHP...

-=kt=-

ktpupp
4th of October 2004 (Mon), 16:16
Could be a bug in the EE code that incorrectly reports the state of safe mode:


<?php
//
// EE code
//
print "<br>PHP maxtime: " . ini_get('max_execution_time');
$val = ini_get("safe_mode");
if ($val == "") $safe_mode = "on";
if ($val != "") $safe_mode = "off";
print "<p>betanote: safe mode is {$safe_mode} {$val}<br>";
//
// My test code
//
if (ini_get("safe_mode")) print "<p>safe mode is on<br>";
if (!ini_get("safe_mode")) print "<p>safe mode is off<br>";
?>


When I run this on my server, the EE code reports safe code as on, while my mode reports it as off.

Deven

FYI, I just ran this same code and got the same results:


PHP maxtime: 360

betanote: safe mode is on

safe mode is off

Dunno if that is related to the two different Safe Modes that Pekka mentioned in the above post. I'm off to search for more info on that subject!

-=kt=-

Pekka
4th of October 2004 (Mon), 16:21
There are two safe mode settings in PHP, "Local Value" and "Master Value". Master is applied to whole server, local to virtual site. Those values can be seen in phpinfo.

You can usually change local value in .htaccess file - don't have details here now but they are there in http://www.php.net website for sure.

ktpupp, what does you graphics modules editor say when you do imagemagick test?

When I run the test, I get the little elk image showing up and the button to click to tell EE that I saw the image and ImageMagick is working:

http://www.sumbler.com/images/EE_IM_test.jpg

Below this image the paths for IM both read PATH OK in green, too.

IM just seems to fail when I am adding pictures from the "Upload to Database" section... :(

Thanks for any help! I'll look for info the Master and Local Safe Mode settings for my PHP...

-=kt=-

As IM is working on test page, it works so safe mode is OK.
Next steps are to check that
- EE folders have correct permissions
- ftp servers work
- paths are correct

On above test page try different profile commands so that you can get image size to about 4KB (with Imagemagick 6 this should be tested on resize methods page with microthumbs - there is a slight change in compression values in version 6)

ktpupp
4th of October 2004 (Mon), 16:24
There are two safe mode settings in PHP, "Local Value" and "Master Value". Master is applied to whole server, local to virtual site. Those values can be seen in phpinfo.


Looks like my Local and Master Values are both turned off:

http://www.sumbler.com/images/php_safe_mode.jpg

If this is not what you are referring to, please give me more info and I will check into it...

-=kt=-

ktpupp
4th of October 2004 (Mon), 16:49
As IM is working on test page, it works so safe mode is OK.
Next steps are to check that
- EE folders have correct permissions
- ftp servers work
- paths are correct

On above test page try different profile commands so that you can get image size to about 4KB (with Imagemagick 6 this should be tested on resize methods page with microthumbs - there is a slight change in compression values in version 6)

~FTP server works because I can upload photos successfully.

~All the folders currently have 777. I figured I would restrict those that need to be after getting everything running, thus eliminating permissions as a problem right now.

~As far as I can tell the paths are correct, but I could be wrong. Any tips for helping to determine which paths might not be correct and what the correct paths should be?

Obviously, the IM paths are correct since the test image gets resized...

Thank you again for your help!

-=kt=-

EDIT: OOOOOHHH! I got it working!!! Your suggestion to try the different profile commands was the magic answer! I tried the first setting in that drop down and now the thumbnails and microthumbs are created!

The only thing I am seeing now is that my main image entry is not the correct size. I might have one of the resizing profiles incorrectly set, so I will post a new thread if I find I am still having trouble!

Thank you SSSSOOOOO much for the help!

-=kt=-

Pekka
4th of October 2004 (Mon), 17:04
One possiblity:

In script input/RESIZE_imagemagick.php change every occurrence of line

if($exec_retval > 0) {

to

if($exec_retval > 1) {

and try again.

The paths are created on the fly, the important one is FTP Folder which is the only thing EE needs to transfer images and create correct path. You can get the base ftp folder by going into your site with ftp and browsing to the folder and giving PWD command (print working directory). But I'm pretty sure this is not the cause for IM problem.

If you like this solved fast, PM me address to your input folder (and passes) and I'll have a look tomorrow afternoon.

jgbiggs
24th of October 2004 (Sun), 12:54
I seem to be having the same problem.

So what is the actual fix? the *.php edit or some parameter in the IM setup?