What's the default location of PHP

How do I find the default location of PHP on my Linux Server (Red Hat Fedora Core 7 - I think).
I need this for the special instructions on setting up a cron job:
In my case, /usr/local/bin is empty.

Ensure that the first line of the cron file is the location of php on the server.  
Default first line entry on this file is:
#!/usr/local/bin/php -q
The /usr/local/bin/php should be the location of php
LVL 8
pzozulkaAsked:
Who is Participating?
 
SteveConnect With a Mentor Network ManagerCommented:
just type 'which php'

and that'll tell you where its installed..

0
 
cjl7Connect With a Mentor freelance for hireCommented:
Or change the #! line to #!/usr/bin/env php -q

//jonas
0
 
woolmilkporcConnect With a Mentor Commented:
.. or check your rpm -
issue 'rpm -qa | grep php ' to find your exact php package name, then
issue 'rpm -qf [package name from above]' to see all the files the rpm package contains.

Easily you will find your php binary and all the other interesting things in there.

wmp
0
Cloud Class® Course: MCSA MCSE Windows Server 2012

This course teaches how to install and configure Windows Server 2012 R2.  It is the first step on your path to becoming a Microsoft Certified Solutions Expert (MCSE).

 
pzozulkaAuthor Commented:
I tried both of your suggestions and get this response, an ideas? Thanks for your help.
Extension '/var/www/vhosts/domain.com/httpdocs/spot/admin/cron/cron_pop.php' not present.

cron_pop.php is the script where I inserted
1) #!/usr/bin/env php -q
2) #!/usr/bin/php -q (<---------result of 'which php')
0
 
pzozulkaAuthor Commented:
Nevermind, in the cron job setup I entered this in the command line instead:
/usr/bin/php /var/www/vhosts/domain.com/httpdocs/spot/admin/cron/cron_pop.php
0
 
SteveNetwork ManagerCommented:
Yeah under cron you need to specify the entire path.. as youve done..

0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.