safe mode help
am 08.04.2008 19:12:31 von rdlowrey
Hi, I'm pulling my hair out trying to make this work and any help
would be appreciated ...
When I try to move the uploaded file:
move_uploaded_file($_FILES["file"]["tmp_name"],"/var/www/vho sts/
mydomain.com/intranet/httpdocs/lib/slips/in/$filename.pdf");
I get the following error:
Warning: move_uploaded_file(): SAFE MODE Restriction in effect. The
script whose uid is 10001 is not allowed to access /var/www/vhosts/
mydomain.com owned by uid 0
However, my phpinfo() tells me that the master value for safe mode is
Off. Why do I keep getting SAFE MODE errors iwhen php tells me that
safe mode is turned off?
Pleeeease help. Thanks.
Re: safe mode help
am 08.04.2008 19:28:11 von Jerry Stuckle
rdlowrey wrote:
> Hi, I'm pulling my hair out trying to make this work and any help
> would be appreciated ...
>
> When I try to move the uploaded file:
> move_uploaded_file($_FILES["file"]["tmp_name"],"/var/www/vho sts/
> mydomain.com/intranet/httpdocs/lib/slips/in/$filename.pdf");
>
> I get the following error:
> Warning: move_uploaded_file(): SAFE MODE Restriction in effect. The
> script whose uid is 10001 is not allowed to access /var/www/vhosts/
> mydomain.com owned by uid 0
>
> However, my phpinfo() tells me that the master value for safe mode is
> Off. Why do I keep getting SAFE MODE errors iwhen php tells me that
> safe mode is turned off?
>
> Pleeeease help. Thanks.
>
What's the local value for safe_mode in phpinfo()? Are you loading the
phpinfo() page from the same directory as you're calling
move_uploaded_file() (i.e. safe_mode could be set on a per-directory
instance)?
--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
jstucklex@attglobal.net
==================
Re: safe mode help
am 08.04.2008 19:52:31 von rdlowrey
Thanks for the quick response.
> What's the local value for safe_mode in phpinfo()?
The local value for safe_mode in phpinfo() is set to On and I've tried
to figure out how to change that because I thought it might have
something to do with it but I've been unsuccessful.
> Are you loading the
> phpinfo() page from the same directory as you're calling
> move_uploaded_file()?
The upload form is in this directory:
/var/www/vhosts/mydomain.com/intranet/httpdocs/receiving/
And it posts to a form-handling php file in the same directory where
the phpinfo call is made:
/var/www/vhosts/mydomain.com/intranet/httpdocs/form_submits. php
/var/www/vhosts/mydomain.com/intranet/httpdocs/phpinfo.php
I'm getting the error in the forms.php file
Re: safe mode help
am 08.04.2008 19:54:06 von rdlowrey
Correction to the last line of my response:
> I'm getting the error in the forms.php file
Should read: I'm getting the error in the form_submits.php file
Re: safe mode help
am 08.04.2008 21:40:22 von Jerry Stuckle
rdlowrey wrote:
> Thanks for the quick response.
>
>> What's the local value for safe_mode in phpinfo()?
> The local value for safe_mode in phpinfo() is set to On and I've tried
> to figure out how to change that because I thought it might have
> something to do with it but I've been unsuccessful.
>
>
>> Are you loading the
>> phpinfo() page from the same directory as you're calling
>> move_uploaded_file()?
>
> The upload form is in this directory:
> /var/www/vhosts/mydomain.com/intranet/httpdocs/receiving/
>
> And it posts to a form-handling php file in the same directory where
> the phpinfo call is made:
> /var/www/vhosts/mydomain.com/intranet/httpdocs/form_submits. php
> /var/www/vhosts/mydomain.com/intranet/httpdocs/phpinfo.php
>
> I'm getting the error in the forms.php file
>
Check your httpd.conf file.
--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
jstucklex@attglobal.net
==================
Re: safe mode help
am 09.04.2008 00:23:04 von rdlowrey
> Check your httpd.conf file.
I'm not an expert in this area and am not sure what to check for ...
Can you be more specific?
I added the following line in my httpd.conf file, but the local value
for safe_mode remains on (and I did restart apache):
ServerAlias intranet.mydomain.com
ServerAdmin webmaster@mydomain.com
DocumentRoot /var/www/vhosts/mydomain.com/subdomains/intranet/
httpdocs
ServerName intranet.mydomain.com
ErrorLog logs/dummy-host.example.com-error_log
CustomLog logs/dummy-host.example.com-access_log common
php_admin_flag safe_mode 0
Obviously I've replaced myip and mydomain.com with the appropriate
values.
Re: safe mode help
am 09.04.2008 04:56:17 von Jerry Stuckle
rdlowrey wrote:
>> Check your httpd.conf file.
>
> I'm not an expert in this area and am not sure what to check for ...
> Can you be more specific?
>
> I added the following line in my httpd.conf file, but the local value
> for safe_mode remains on (and I did restart apache):
>
>
> ServerAlias intranet.mydomain.com
> ServerAdmin webmaster@mydomain.com
> DocumentRoot /var/www/vhosts/mydomain.com/subdomains/intranet/
> httpdocs
> ServerName intranet.mydomain.com
> ErrorLog logs/dummy-host.example.com-error_log
> CustomLog logs/dummy-host.example.com-access_log common
> php_admin_flag safe_mode 0
>
>
> Obviously I've replaced myip and mydomain.com with the appropriate
> values.
>
>
This should be
php_admin_flag safe_mode off
not zero.
The only two places you should be able to set safe_mode are in php.ini
and in httpd.conf. Otherwise it is restricted (so people can't turn it
off).
Check the rest of your httpd.conf file - is it set globally? If so, I'm
not sure you can turn it off like that. But then I've never tried, either.
And just in case, check your php.ini file - and see if you have more
than one on your system.
--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
jstucklex@attglobal.net
==================
Re: safe mode help
am 09.04.2008 16:52:10 von rdlowrey
Thanks for the help. I just needed to make some changes in my
vhost.conf file ...
Between your suggestions and a little Googling I've gotten it working.
Many thanks!