patrick010 Posted April 26, 2007 Share Posted April 26, 2007 Hello all! I have been using php exec in combination with tar to unzip files on a suse 9.2 system. This always worked great. Example code: exec("'tar -xf /blueprints/somefile.tar -C /home/somedirectory & '"); However. Since i upgraded my system to suse 10.2 the php webpage will hang as soon as this command is executed. With suse 9.2 there was no problem backgrounding the command with a simple &. With 10.2 however it seems impossible to background the process. I have also tried some variations like: exec("'tar -xf /blueprints/somefile.tar -C /home/somedirectory 2>&1 & '"); But everytime the page will simply hang. Im am by no means a php expert or a linux expert for that matter so im somewhat at a loss. Im hoping somebody might be able to provide a solution on how to force it into the background so the php page doesent hang as soon as the tar command is executed. Any help will be very much apriciated. Many thanks, Patrick Link to comment https://forums.phpfreaks.com/topic/48709-php-exec-issues-with-suse-102/ Share on other sites More sharing options...
patrick010 Posted April 26, 2007 Author Share Posted April 26, 2007 Ok, ive been running some tests. Seems with php4 the command : exec("'tar -xf /blueprints/somefile.tar -C /home/somedirectory > /dev/null 2>&1 & '"); works perfect. The command will run nicely in the background and the webpage executing the command wont hang. With php5 it will just hang the webpage until the tar command is done unzipping the file. Has anybody expirienced this problem or know of a solution ? Link to comment https://forums.phpfreaks.com/topic/48709-php-exec-issues-with-suse-102/#findComment-238828 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.