Jump to content

php exec issues with suse 10.2


patrick010

Recommended Posts

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

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 ?

 

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.