Can someone please give me a short script to execute a system command using PHP running under windows? Iv'e tried exec(), popen(), system() with no luck. Are these only for UNIX?
Thanks.
Dave
| SitePoint Sponsor |




Can someone please give me a short script to execute a system command using PHP running under windows? Iv'e tried exec(), popen(), system() with no luck. Are these only for UNIX?
Thanks.
Dave




To be accurate the code seems to run the script just never finishes and the system command does not seem to execute with my windows attempt.
Dave![]()





I've never tried to use PHP with Windows, however, you said the script couldn't finish, what about infinite loops or anything other than the system calls that might cause the problem?
- Son Nguyen
AdSpeed.com - Ad Serving and Ad Management Made Easy




Thanks for the reply. I don't know what is happening, the browser hourglass never goes away. I thought if I could find someone who has done system commands from PHP under Windows, that I may be overlooking something.
However, let's also discuss what I am trying to do, maybe there is a better way. I generate quite a few web site statistics reports using Analog (great product), however as far as I can tell there is only one analog.cfg file and it must be used when running analog.exe. Well I wrote a PHP script to create new analog.cfg files for each web site, but I need to run analog.exe after each analog.cfg change. Seems stupid, and I could do it with another language, but sense I'm serious about increasing my PHP4 skills I thought I'd use it.
Thanks and any more suggestions appreciated.
Dave




I'm still totally stuck on issueing system commands with PHP4, Apache and Windows. I wonder if this a PHP4 issue or an Apache issue. I seem to be able to read and write to files just fine, but when I issue a system comand it just hangs.
Are system commands working for anyone under Windows / Apache - thanks..... very frustrated on this one.
![]()
Dave





Try looking at http://php.net/manual/en/function.system.php . It seems people are having related problems, in the comments section.
Bookmarks