PHP shell_exec times out, but not when executed manuallyUseful Command-line Commands on WindowsWhy shell...

Python if-else code style for reduced code for rounding floats

Explaining pyrokinesis powers

What is the relationship between relativity and the Doppler effect?

If I can solve Sudoku, can I solve the Travelling Salesman Problem (TSP)? If so, how?

Bacteria contamination inside a thermos bottle

How to write cleanly even if my character uses expletive language?

Violin - Can double stops be played when the strings are not next to each other?

Print a physical multiplication table

Have the tides ever turned twice on any open problem?

What is a ^ b and (a & b) << 1?

PTIJ: Who should I vote for? (21st Knesset Edition)

Book: Young man exiled to a penal colony, helps to lead revolution

Adventure Game (text based) in C++

Why Choose Less Effective Armour Types?

Why did it take so long to abandon sail after steamships were demonstrated?

Examples of transfinite towers

Employee lack of ownership

What is the adequate fee for a reveal operation?

While on vacation my taxi took a longer route, possibly to scam me out of money. How can I deal with this?

How can we have a quark condensate without a quark potential?

Could the Saturn V actually have launched astronauts around Venus?

What's the meaning of a knight fighting a snail in medieval book illustrations?

Instead of a Universal Basic Income program, why not implement a "Universal Basic Needs" program?

Is it ever recommended to use mean/multiple imputation when using tree-based predictive models?



PHP shell_exec times out, but not when executed manually


Useful Command-line Commands on WindowsWhy shell command runs from command line but not from php script?Why is my application hanging when ran from the webserver?What is “php exited with error code 1”?Fedora 15 PHP exec() does not workNginx server goes down when php file is executed in command linePHP remote network location not appearingFFMPEG works on Console but doesn't work in PHP script on UbuntuCron appears to run but doesn't execute in the same way as when run manually from the terminal500 error for PHP script with cron, but not CLI













0















I have a Windows 2008 server with PHP and msys installed. I also have a simple php script that calls shell_exec and tars a few files. When I run the script on my development machine (Windows 7), it works fine. However, when I run it on the Windows 2k8 server, it times out. When I copy and paste exactly what's being run on the cmd line and run it, it executes w/out error in less than a second.



One more important detail: when I shell_exec 'dir' or 'netstat', the script runs without any problems. When I shell_exec 'ls' it hangs. When I run ls on the command line, it returns immediately.



Other details that might be useful:
The Windows 2k8 server is a VPS hosted by Rackspace. I did vanilla installs of Apache, PHP, and msys, but I haven't installed anything else.



When I run whoami, I see the php script is executing as the user "nt authoritysystem".










share|improve this question














bumped to the homepage by Community 13 mins ago


This question has answers that may be good or bad; the system has marked it active so that they can be reviewed.
















  • Have you checked permissions to make sure the System account can access all of the necessary folders?

    – Matthew
    Apr 22 '10 at 13:20
















0















I have a Windows 2008 server with PHP and msys installed. I also have a simple php script that calls shell_exec and tars a few files. When I run the script on my development machine (Windows 7), it works fine. However, when I run it on the Windows 2k8 server, it times out. When I copy and paste exactly what's being run on the cmd line and run it, it executes w/out error in less than a second.



One more important detail: when I shell_exec 'dir' or 'netstat', the script runs without any problems. When I shell_exec 'ls' it hangs. When I run ls on the command line, it returns immediately.



Other details that might be useful:
The Windows 2k8 server is a VPS hosted by Rackspace. I did vanilla installs of Apache, PHP, and msys, but I haven't installed anything else.



When I run whoami, I see the php script is executing as the user "nt authoritysystem".










share|improve this question














bumped to the homepage by Community 13 mins ago


This question has answers that may be good or bad; the system has marked it active so that they can be reviewed.
















  • Have you checked permissions to make sure the System account can access all of the necessary folders?

    – Matthew
    Apr 22 '10 at 13:20














0












0








0








I have a Windows 2008 server with PHP and msys installed. I also have a simple php script that calls shell_exec and tars a few files. When I run the script on my development machine (Windows 7), it works fine. However, when I run it on the Windows 2k8 server, it times out. When I copy and paste exactly what's being run on the cmd line and run it, it executes w/out error in less than a second.



One more important detail: when I shell_exec 'dir' or 'netstat', the script runs without any problems. When I shell_exec 'ls' it hangs. When I run ls on the command line, it returns immediately.



Other details that might be useful:
The Windows 2k8 server is a VPS hosted by Rackspace. I did vanilla installs of Apache, PHP, and msys, but I haven't installed anything else.



When I run whoami, I see the php script is executing as the user "nt authoritysystem".










share|improve this question














I have a Windows 2008 server with PHP and msys installed. I also have a simple php script that calls shell_exec and tars a few files. When I run the script on my development machine (Windows 7), it works fine. However, when I run it on the Windows 2k8 server, it times out. When I copy and paste exactly what's being run on the cmd line and run it, it executes w/out error in less than a second.



One more important detail: when I shell_exec 'dir' or 'netstat', the script runs without any problems. When I shell_exec 'ls' it hangs. When I run ls on the command line, it returns immediately.



Other details that might be useful:
The Windows 2k8 server is a VPS hosted by Rackspace. I did vanilla installs of Apache, PHP, and msys, but I haven't installed anything else.



When I run whoami, I see the php script is executing as the user "nt authoritysystem".







windows windows-server-2008 php






share|improve this question













share|improve this question











share|improve this question




share|improve this question










asked Apr 22 '10 at 4:14









Breck FresenBreck Fresen

264




264





bumped to the homepage by Community 13 mins ago


This question has answers that may be good or bad; the system has marked it active so that they can be reviewed.







bumped to the homepage by Community 13 mins ago


This question has answers that may be good or bad; the system has marked it active so that they can be reviewed.















  • Have you checked permissions to make sure the System account can access all of the necessary folders?

    – Matthew
    Apr 22 '10 at 13:20



















  • Have you checked permissions to make sure the System account can access all of the necessary folders?

    – Matthew
    Apr 22 '10 at 13:20

















Have you checked permissions to make sure the System account can access all of the necessary folders?

– Matthew
Apr 22 '10 at 13:20





Have you checked permissions to make sure the System account can access all of the necessary folders?

– Matthew
Apr 22 '10 at 13:20










1 Answer
1






active

oldest

votes


















0














It most likely is permissions or an environment variable. If you are using any environment variables in your script double-check that they are also set when run via cron, as the environment vars are often not the same as they are for your normal login shell.



If its not environment, just start double checking permissions.






share|improve this answer























    Your Answer








    StackExchange.ready(function() {
    var channelOptions = {
    tags: "".split(" "),
    id: "2"
    };
    initTagRenderer("".split(" "), "".split(" "), channelOptions);

    StackExchange.using("externalEditor", function() {
    // Have to fire editor after snippets, if snippets enabled
    if (StackExchange.settings.snippets.snippetsEnabled) {
    StackExchange.using("snippets", function() {
    createEditor();
    });
    }
    else {
    createEditor();
    }
    });

    function createEditor() {
    StackExchange.prepareEditor({
    heartbeatType: 'answer',
    autoActivateHeartbeat: false,
    convertImagesToLinks: true,
    noModals: true,
    showLowRepImageUploadWarning: true,
    reputationToPostImages: 10,
    bindNavPrevention: true,
    postfix: "",
    imageUploader: {
    brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
    contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
    allowUrls: true
    },
    onDemand: true,
    discardSelector: ".discard-answer"
    ,immediatelyShowMarkdownHelp:true
    });


    }
    });














    draft saved

    draft discarded


















    StackExchange.ready(
    function () {
    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fserverfault.com%2fquestions%2f134751%2fphp-shell-exec-times-out-but-not-when-executed-manually%23new-answer', 'question_page');
    }
    );

    Post as a guest















    Required, but never shown

























    1 Answer
    1






    active

    oldest

    votes








    1 Answer
    1






    active

    oldest

    votes









    active

    oldest

    votes






    active

    oldest

    votes









    0














    It most likely is permissions or an environment variable. If you are using any environment variables in your script double-check that they are also set when run via cron, as the environment vars are often not the same as they are for your normal login shell.



    If its not environment, just start double checking permissions.






    share|improve this answer




























      0














      It most likely is permissions or an environment variable. If you are using any environment variables in your script double-check that they are also set when run via cron, as the environment vars are often not the same as they are for your normal login shell.



      If its not environment, just start double checking permissions.






      share|improve this answer


























        0












        0








        0







        It most likely is permissions or an environment variable. If you are using any environment variables in your script double-check that they are also set when run via cron, as the environment vars are often not the same as they are for your normal login shell.



        If its not environment, just start double checking permissions.






        share|improve this answer













        It most likely is permissions or an environment variable. If you are using any environment variables in your script double-check that they are also set when run via cron, as the environment vars are often not the same as they are for your normal login shell.



        If its not environment, just start double checking permissions.







        share|improve this answer












        share|improve this answer



        share|improve this answer










        answered Apr 6 '11 at 3:47









        opsguyopsguy

        621411




        621411






























            draft saved

            draft discarded




















































            Thanks for contributing an answer to Server Fault!


            • Please be sure to answer the question. Provide details and share your research!

            But avoid



            • Asking for help, clarification, or responding to other answers.

            • Making statements based on opinion; back them up with references or personal experience.


            To learn more, see our tips on writing great answers.




            draft saved


            draft discarded














            StackExchange.ready(
            function () {
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fserverfault.com%2fquestions%2f134751%2fphp-shell-exec-times-out-but-not-when-executed-manually%23new-answer', 'question_page');
            }
            );

            Post as a guest















            Required, but never shown





















































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown

































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown







            Popular posts from this blog

            Фонтен-ла-Гаярд Зміст Демографія | Економіка | Посилання |...

            Список ссавців Італії Природоохоронні статуси | Список |...

            Маріан Котлеба Зміст Життєпис | Політичні погляди |...