SitePoint Sponsor

User Tag List

Results 1 to 6 of 6

Hybrid View

  1. #1
    SitePoint Guru DenverDave's Avatar
    Join Date
    Feb 2001
    Location
    Denver, Colorado
    Posts
    630
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    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

  2. #2
    SitePoint Guru DenverDave's Avatar
    Join Date
    Feb 2001
    Location
    Denver, Colorado
    Posts
    630
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Actually hangs

    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

  3. #3
    AdSpeed.com Son Nguyen's Avatar
    Join Date
    Aug 2000
    Location
    Silicon Valley
    Posts
    2,241
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    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

  4. #4
    SitePoint Guru DenverDave's Avatar
    Join Date
    Feb 2001
    Location
    Denver, Colorado
    Posts
    630
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    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

  5. #5
    SitePoint Guru DenverDave's Avatar
    Join Date
    Feb 2001
    Location
    Denver, Colorado
    Posts
    630
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    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

  6. #6
    SitePoint Wizard
    Join Date
    Jul 1999
    Location
    Chicago
    Posts
    2,629
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Try looking at http://php.net/manual/en/function.system.php . It seems people are having related problems, in the comments section.


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •