SRCDS implementation

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
aquadeluxe
Forum Newbie
Posts: 6
Joined: Mon Mar 31, 2008 7:18 pm

SRCDS implementation

Post by aquadeluxe »

I am working on a script that will allow me to install a game server with SRCDS.

I use this code:

Code: Select all

echo system("cd /location/to/srcds && ./steam -command update -game \"Counter-Strike Source\" -dir ./test");

and it gives me this "Checking bootstrapper version ... Unable to write to the current Steam application folder. Please move Steam to a folder where you have write privileges. "

I set the srcds to 777 and I tried with the user and group as apache, but it still gives me the same error.

Safe mode is off, btw.

Is there a way I can get this to work, or do I need to use something other than PHP for this?
WebbieDave
Forum Contributor
Posts: 213
Joined: Sun Jul 15, 2007 7:07 am

Re: SRCDS implementation

Post by WebbieDave »

Try writing to the location with your own PHP code to see if it works. Also, check your open_basedir setting.
aquadeluxe
Forum Newbie
Posts: 6
Joined: Mon Mar 31, 2008 7:18 pm

Re: SRCDS implementation

Post by aquadeluxe »

Hmm, it seems as though that is the problem. I try to write to a file and it gives me "failed to open stream: Permission denied"

How would I go about using open_basedir in my script?
WebbieDave
Forum Contributor
Posts: 213
Joined: Sun Jul 15, 2007 7:07 am

Re: SRCDS implementation

Post by WebbieDave »

open_basedir is a configuration setting.

http://us2.php.net/features.safe-mode
aquadeluxe
Forum Newbie
Posts: 6
Joined: Mon Mar 31, 2008 7:18 pm

Re: SRCDS implementation

Post by aquadeluxe »

When I try using fopen and fwrite to a file with an absolute path "/path/to/directory/and/file.ext", it will give me errors if the file isn't already created, but if I use a relative path "../file.ext", it will work fine. I was using "w+" with fopen.

When I use both absolute and relative paths to the srcds directory, it gives me the same error. I have looked at what open_basedir is set to, and it seems like it is set perfectly perfect.

It would be great if someone can help further, and thanks for all of the help already.
Post Reply