8 replies
This cron used to work till yesterday. It suddenly stopped working. I am getting the following output. Any ideas?

/bin/sh: /usr/local/bin/php: No such file or directory
#cron #error
  • Profile picture of the author freehugs
    Hmm, I don't know what distro of linux you are using, but generally PHP is installed in /usr/bin/php not /usr/local/bin/php. Perhaps you had a symlink there that disappeared?
    {{ DiscussionBoard.errors[4911622].message }}
  • Profile picture of the author KirkMcD
    Ask your host.
    {{ DiscussionBoard.errors[4913341].message }}
  • Profile picture of the author wasabi20
    Add:

    #!/usr/bin/php

    in the top of your php file

    Good luck
    {{ DiscussionBoard.errors[5025921].message }}
  • Profile picture of the author casius
    Actually, what you need to do is to find the right the path for your PHP location. As I see that either your PHP path is incorrect or the path to your executable file is incorrect. By the way to find the right path of PHP check PHP info of your web hosting provider
    Signature
    Cloud VPS || Shared Hosting
    Web Hosting Solutions for Geeks!
    HOST1PLUS
    {{ DiscussionBoard.errors[5200614].message }}
  • Profile picture of the author RobKonrad
    1. Create a simple php file called info.php with the following content:

    <?php
    phpinfo();
    ?>

    2. Copy this file to your web server.

    3. Then open this php file with your browser.

    Inside the report you will see path to php.ini in the row called
    Configuration File (php.ini) Path.

    Cheers,
    Rob
    Signature
    ================================================== ===
    This blog is awesome: http://www.robkonrad.com/blog. Read it.
    ================================================== ===
    {{ DiscussionBoard.errors[5201735].message }}
  • Profile picture of the author msam029
    Yes the php is mostly /usr/bin/php in cent and ubuntu flovours try getting it by whereis php or from php info
    {{ DiscussionBoard.errors[5201833].message }}
  • Profile picture of the author jrim
    Just wanted to chime in that you can also try running the cron command with the prefix of the path to php, e.g. instead of only having your cron script use the path to the file as the argument, try something like:

    Code:
    28 14 * * * /usr/local/bin/php -q /yourscript.php
    (or whatever the path to your php bin is)

    -q flag suppresses HTTP header output.
    {{ DiscussionBoard.errors[5201974].message }}
  • Profile picture of the author ezkl
    Provided you have ssh access, login and run:
    Code:
    which php
    This will return the full path to the php binary.
    {{ DiscussionBoard.errors[5206496].message }}

Trending Topics