animuson Posted April 4, 2009 Share Posted April 4, 2009 I'm having trouble figuring out how to word this properly so I also had trouble searching for how to do it. I was wondering if it was possible to use PHP to edit files on a different part of the server. Like my PHP file is located at /home/domains/animuson.com/form.php and I want to be able to edit a file at /etc/game/servers/[server]/config.cfg Link to comment https://forums.phpfreaks.com/topic/152548-editing-files-on-server/ Share on other sites More sharing options...
kenrbnsn Posted April 4, 2009 Share Posted April 4, 2009 If the process running the script has the correct privileges to read/write the file, yes you can do that with php. Ken Link to comment https://forums.phpfreaks.com/topic/152548-editing-files-on-server/#findComment-801214 Share on other sites More sharing options...
animuson Posted April 4, 2009 Author Share Posted April 4, 2009 Ok so how would I do it? Can I just add the / at the front to specify which folder? I don't know if DirectAdmin will let me out of my root HTML folders. Link to comment https://forums.phpfreaks.com/topic/152548-editing-files-on-server/#findComment-801217 Share on other sites More sharing options...
kenrbnsn Posted April 4, 2009 Share Posted April 4, 2009 You will just have to try. Put in the full path to the file. Ken Link to comment https://forums.phpfreaks.com/topic/152548-editing-files-on-server/#findComment-801230 Share on other sites More sharing options...
animuson Posted April 4, 2009 Author Share Posted April 4, 2009 Warning: fopen() [function.fopen]: open_basedir restriction in effect. File(/etc/game/servers/racing/settings.cfg) is not within the allowed path(s): (/home/admin/:/tmp:/usr/local/lib/php/) in /home/admin/domains/[domain]/public_html/smanage.php on line 4 Warning: fopen(/etc/game/servers/racing/settings.cfg) [function.fopen]: failed to open stream: Operation not permitted in /home/admin/domains/[domain]/public_html/smanage.php on line 4 Can't open file * Removed the domain It won't let me get out of the /home directory. Any ideas? Link to comment https://forums.phpfreaks.com/topic/152548-editing-files-on-server/#findComment-801253 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.