exec in PHP 5.4

Alles, was PHP betrifft, kann hier besprochen werden.

exec in PHP 5.4

Postby GerhardB » 21. September 2012 16:21

In my PHP programs I call a lot of external programs. In my earlier PHP setup (through xampp 1.7), all worked well.

Not anymore: With the new PHP 5.4.4, none of the commands: exec, system, shell_exec etc work anymore.

I tested exec("whatever.exe") with a path to either C:\path\ on the local drive or to the document root or to the folder of the calling PHP - no success. I also created a batch file calling the exe files. Either there is no reaction or the display of the batch file in the browser. Even $dir = shell_exec('dir C:'); does not run anymore

I know this has been covered various times in the past, but none of the advices helped.

How can I reactivate (I guess, open the security). I checked the disable_functions, open_basedir, safe_mode_exec_dir in php.ini: All blank.

My system: xampp 1.8.0 with PHP 5.4.4 (VC9 x86), Apache 2.4.2, MySQL 5.5.25, Win 7/64, Apache and MySQL installed as services, xampp control panel 3.

Any help will be appreciated.

Gerhard
GerhardB
 
Posts: 5
Joined: 21. September 2012 16:06
Operating System: Win 7/64

Re: exec in PHP 5.4

Postby zoghal » 21. September 2012 20:55

I have exactly this problem.
My system specs are exactly the same as you
zoghal
 
Posts: 2
Joined: 21. September 2012 20:47
Operating System: Windows 7 64bit

Re: exec in PHP 5.4

Postby webworld » 08. October 2012 09:18

May you could get some ideas from the following:-

Sometimes notepads dont open because it is an interactive program.

For Tasks scheduler, gives read and write permissions to the task folder (C:\Windows\System32\Tasks) to IUSR.
webworld
 
Posts: 1
Joined: 08. October 2012 09:08
Operating System: Mac

Re: exec in PHP 5.4

Postby GerhardB » 14. October 2012 16:29

Dear Zoghal et.al.,

After many hours of testing, I managed to solve my problem of exec() calls in PHP. This might be useful also for other developers, as I have seen many struggling with te same problem.

1. xampp must be installed in real (!) administrator mode (in Windows 7 / 32 & 64 bit).

2. In many environments, Apache and MySQL should not run as services, but be manually started (even not with interaction with desktop).

I have put a step-by-step procedure to troubleshoot at:

http://www.gerhardbechtold.com/LUPMIS/Manual/a15_xamppmap_maker_installation.html

(Ignore the references to our system LUPMIS).

No problem with Notepad.

Good luck to everybody
Gerhard
GerhardB
 
Posts: 5
Joined: 21. September 2012 16:06
Operating System: Win 7/64

Re: exec in PHP 5.4

Postby zoghal » 15. October 2012 15:56

GerhardB wrote:Dear Zoghal et.al.,

After many hours of testing, I managed to solve my problem of exec() calls in PHP. This might be useful also for other developers, as I have seen many struggling with te same problem.

1. xampp must be installed in real (!) administrator mode (in Windows 7 / 32 & 64 bit).

2. In many environments, Apache and MySQL should not run as services, but be manually started (even not with interaction with desktop).

I have put a step-by-step procedure to troubleshoot at:

http://www.gerhardbechtold.com/LUPMIS/Manual/a15_xamppmap_maker_installation.html

(Ignore the references to our system LUPMIS).

No problem with Notepad.

Good luck to everybody
Gerhard

thanks Gerhard, but i manually update to last php version, it is ok
zoghal
 
Posts: 2
Joined: 21. September 2012 20:47
Operating System: Windows 7 64bit


Return to PHP

Who is online

Users browsing this forum: No registered users and 18 guests