Forum Moderators: coopster
Unfortunately my client is on holidays and I don't have their browser or platform data (tho it's IE and Win) and I'm not sure if they have a firewall.
Here are the errors:
Warning: set_time_limit() [function.set-time-limit]:
Cannot set time limit in safe mode
in /usr/www/mydomain.com/manager.php on line 93Warning: fopen() [function.fopen]: open_basedir
restriction in effect. File(/var/tmp/phplIS9SO) is not
within the allowed path(s): (.)
in /usr/www/mydomain.com/manager.php on line 100Warning: fopen(/var/tmp/phplIS9SO) [function.fopen]:
failed to create stream: Operation not permitted
in /usr/www/mydomain.com/manager.php on line 100Warning: filesize() [function.filesize]: open_basedir
restriction in effect. File(/var/tmp/phplIS9SO) is not
within the allowed path(s): (.)
in /usr/www/mydomain.com/manager.php on line 100Warning: fread(): supplied argument is not a valid stream
resource in /usr/www/mydomain.com/manager.php on line 100
and line 100:
$data = addslashes(fread(fopen($temp, "rb"), filesize($temp)));
Not being able to recreate the problem at work makes this a bit of a pain in the **s. Any ideas would be greatly appreciated.
[edited by: coopster at 3:42 pm (utc) on Oct. 13, 2003]
The weird thing is that in speaking with another client, they mentioned that they had the same error on one of their personal computers, but not the ones at the office.
I'm trying to get all of the details on systems etc., but it's weird to me as it seems that it should be a server side problem.
I've sent a bote to the hosting co., hopefully they'll have an idea wrt some of what you mentioned earlier... (file and directory setting etc...)
(the more I learn the more I want my own serevr...)
Is it just me though, or is it weird that the error goes off on their machines and not ours?
It's just you ;-)
No seriously, it isn't weird. As Coopster mentioned, the client server is running in safe mode. That is not the default install for PHP, so you do not have it set on your machine.
The first error is a direct result of being in safe mode, as it says in the error message.
The second and fourth errors are as well I think. I haven't checked, but I believe that there are basedir restrictions when running in safe mode (I've run into the same problem and it was caused by running under safe_mode, though of course that isn't the only reason you could run into it).
Errors 3 and 5 might also be related or could have to do with directory permissions.
Try setting your local machine to run in safe mode (set it in php.ini) and then see what you get locally.
Tom
Try setting your local machine to run in safe mode (set it in php.ini) and then see what you get locally.
Thanks :-]
WRT the directory and permission settings, my hosting guy tells me...
trying to write to /var/tmp/ ...which you can't do. you're allowed to write to /usr/www/mydomain.com
This is all good and well, but isn't that something that he has to specify in the php.ini on the server? From what I read searching around, there is no workaround for this...
(something is telling me that I'm screwed here)
I'm still having the problem in msg#7 above. Any ideas?
No seriously, it isn't weird. As Coopster mentioned, the client server is running in safe mode. That is not the default install for PHP, so you do not have it set on your machine.
This still isn't clear to me:
I have uploaded the script to an external server. While on that server, I can always upload images, while my client can *sometimes* upload images. This should have nothing to do with what I have set on my machine, no?
I had a similar experience some time ago. I could upload files to a client's site just fine. Sometimes the client could too. And the exact same script also worked fine for other clients. But this client would usually get my failure messages when trying to upload from his office computer.
The only difference between him and everyone else was that most of the files he was trying to upload had upper case extensions.
I hope it's as simple as that for you. I'm not sure under what conditions you call set_time_limit(), down on line 93, but if it's part of a validation condition, it may never get called when an upload goes smoothly. After that, fopen() will break if your validation has prevented the file from being saved to /var/tmp/. Then all operations on a file the script wrongly assumes is open will break, too.
Thanks for that great explanation! I'm a bit new to PHP but learning and loving it. That sounds like a picky little 'bug' you ran into.
Anyway, we aren't using ereg() in this case. I've spoken with our service provider and they've changed the temp directory in their php.ini so I'll have our clients try it out later today.
Cheers - mipapage
Some added information for the description of the error, maybe this will help someone?
Here's the word. Apparently it was a temp path thing. I have no idea why it would work sometimes yes and others no. Not knowing the exact setup of the server makes it tough for me to troubleshoot.
Anyway, to close the topic, the idea in msg#7 worked. They set the value for the temp directory in their php.ini file and viola! (that's right, viola), it works.
WRT file size restrictions I didn't get the data but have tried uploading up to the set (php) MAX_FILE_SIZE and it worked, for me. They were uploading 9k images as test files.