Log in

No account? Create an account

Before | After

php Configuration issues

If you aren't computer minded, you probably will just want to skip this post.

Any one out there know much about php, specifically about configuration?

I'm the web monkey for the World of Warcraft guild I'm in, Cold Blood. I've gotten the forums working without a problem, and now I'm trying to get the next stage of the site moving with the addition of the Guild Roster.

Now, this is done by using a product called WowRoster. What you do is you install an addon into your World of Warcraft application, and it gathers character and guild information and saves it to a file. Once you exit the game, you then upload the file to the WowRoster product which imports it all to it's database and then displays it, so we have an up to date list of the Guild members and their capabilities.

The problem I'm having is in uploading the files. The php system on the website has the "open_basedir" restriction in place. This means that the system will only let you access files that are within the specified directories (or sub-directories), making the system secure against tampering. The problem is that the default upload directory is not listed in the open_basedir directive, so while I can upload the files to the server properly, I can't actually process them, making the entire process useless.

The phpinfo() for the site lists the open_basedir as "D:\Hosting\randomevent\random\wowcoldblood.com" which is the physical location on the server where the website root is located. However, the default upload directory is "C:\uploadtemp\" which is not under that directory.

I've been speaking (well, emailing actually) with the tech support guy at my web host, and he says that the has added the upload directory to the php.ini file (located at "C:\WINDOWS\php.ini" according to the phpinfo()) but it's not recognising the change. I know there's a lot of smart, tech savy people out there, so what are we missing?

This is driving me up the wall, because it's one of the essential things that we want on the web site.



( 7 comments — Leave a comment )
Aug. 24th, 2006 06:36 am (UTC)
Did your techie restart the server after making the changes? It may not need it, but often configuration changes need a reboot before they start working...
Aug. 24th, 2006 09:07 am (UTC)
or at least those services that usethe ini file....
Aug. 26th, 2006 07:12 am (UTC)
I'm showing my biases here, but restarting the relevant service on a Win32 box doesn't guarantee the server's going to drop the offending config from the RAM. Whereas a reboot will.

Still, it dounds like this so-called hosting company hasn't managed to do either.
Aug. 24th, 2006 09:16 am (UTC)
It may not be the server that needs restarting, but the service.

I had a bitch of a time getting PHP up and running on my test box. Eventually it just suddenly started working after a cold boot, with no other changes.

Is there a way of redirecting the standard upload instead? Or of mapping it to somewhere else?
Aug. 24th, 2006 10:56 am (UTC)
Actually I'd take that approach too.

There is possibly an .ini or setup file that hasn't been located and modified - OR there is an environment variable for the upload directory that can be modded.

Last resort, use "assign" or something to map the directory elsewhere (symbolic link in unix land).

My 2c.
Aug. 24th, 2006 10:48 pm (UTC)
Hey Mate,

Sorry I hadn't checked livejournal yesterday, so I hope I can be of some help today...

First: from memory Php has two locations that it looks for the ini file in, I think it's the directory that php.exe is in, and the system root directory.

Second: I've heard of some builds of php only read their ini files on startup, so what your looking for is a service bounce (or a server bounce).

Third: the php upload is really difficult to get your head around, even if your running it on a microsoft box you should still treat the file names like they were *nix files.

Fourth www.php.net and www.zend.net are your friends

Fifth: if your still having trouble, I can dig up some scripts that I wrote for uploading pictures to an e-comerce website I was working on, I just gotta dig it up.

I hope this helps! By the way, if any of these things do help, do I get bonus experience points for Zebzdiah? - "by Gumbo!"
Aug. 26th, 2006 08:43 am (UTC)
You must be having a good birthday. You've also been good and left the PHP file with the best diagnostic command in the language online and named in a way I could locate quickly. ;)

I've had a little squiz and isolated the cause, at least I think I have. The open_basedir value has been configured properly, but it's not actually what's controlling the function you're trying to use. The flag that needs to be fixed is upload_tmp_dir, which still points to the offending directory. It needs to point to something you have access to, possibly to a directory that's not in your web root (i.e. "www/").

Failing that, there are a couple of potential workarounds. The first will work, but is very fiddly, while the second might not work.

From the looks of things, though, you were trying to upload stuff to a forum. The forum just needs the data saved to the relevant MySQL table. So if you located the SQL command they use, you could connect directly to the MySQL service from a remote location (you can also make remote backups the same way). That's likely to get a little too annoying, though, so if they've got phpMyAdmin installed it could be a little easier.

Another workaround which might work it to write a little VB script (or even .bat file) that, after the files have been uploaded, copies them from the uploadtemp/ directory to the directory you want it in. This may or may not work, depending on how hardened the server really is.

Obviously the best solution would be for the host to fix that second variable.
( 7 comments — Leave a comment )

Latest Month

July 2016

Desert Rose

I dream of rain
I dream of gardens in the desert sand
I wake in vain
I dream of love as time runs through my hand

I dream of fire
Those dreams are tied to a horse that will never tire
And in the flames
Her shadows play in the shape of a man's desire

This desert rose
Each of her veils, a secret promise
This desert flower
No sweet perfume ever tortured me more than this

And as she turns
This way she moves in the logic of all my dreams
This fire burns
I realize that nothing's as it seems

I dream of rain
I dream of gardens in the desert sand
I wake in vain
I dream of love as time runs through my hand

I dream of rain
I lift my gaze to empty skies above
I close my eyes
This rare perfume is the sweet intoxication of her love

I dream of rain
I dream of gardens in the desert sand
I wake in vain
I dream of love as time runs through my hand

Sweet desert rose
Each of her veils, a secret promise
This desert flower
No sweet perfume ever tortured me more than this

Sweet desert rose
This memory of Eden haunts us all
This desert flower
This rare perfume, is the sweet intoxication of the fall


Powered by LiveJournal.com
Designed by Teresa Jones