Announcement

Collapse
No announcement yet.

Where is the PHP executable on the server?

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Where is the PHP executable on the server?

    I am running a script on the server. I need to create a cron job for the script and its not running when I setup like this:

    Code:
    */5 * * * * php /home/....etc/cron.php
    I migrated this script fr om CentOS and it worked fine on CentOS. So Im thinking maybe the path to php is different on CloudLinux? Is that true? I created phpinfo() file but that seems to not show a path to the PHP executable... wh ere can I find that? Thanks~

  • #2
    If we are talking about cpanel then standard path even in cagefs inside is /usr/local/bin/php . However easier way to find it is to do which php as a user.

    Comment


    • #3
      Great, thank you~

      Comment


      • #4
        Hmmm, Im still having issues using a cron with php and curl. For example, here is one of my cron jobs:

        Code:
        /usr/bin/curl --silent [URL]http://www.domain.com/runscript.php[/URL] >/dev/null 2>&1
        Is there something wrong with the output above? I see on 3 different accounts they have not run the script for about 2 months, but they should run a few times day. Is the path to curl incorrect on the cloudlinux/cpanel setup? This ran fine for me for a few years on a previous CentOS server. Thanks for your advice~

        Comment


        • #5
          This syntax is Ok and it should be run by cron. Maybe some other issues with it? First thing to check is to launch it manually:

          Code:
          su -l user -s /bin/bash
          
          /usr/bin/curl --silent [URL]http://www.domain.com/runscript.php[/URL]

          Comment


          • #6
            Ok I think I found the problem, and it probably is probably not related to CloudLinux or location of curl. The actual format of the curl url is this:

            Code:
            /usr/bin/curl --silent [URL]http://www.domain.com/runscript?name=variable[/URL]
            If I ran that previously on CentOS, it went well. So I just tested this on CloudLinux and it worked well:

            Code:
            /usr/bin/curl --silent [URL]http://www.domain.com/runscript/?name=variable[/URL]
            So adding that slash after runscript appears to have solved the problem. I have the same issue on other accounts, so will test on others and monitor for a few days to see if all appears fine.

            Comment

            Working...
            X