PDA

View Full Version : I Need PHP CLI, What's The Quickest / Easiest Way To Install It?



open4biz
12th October 2007, 05:28 PM
I have PHP v5.1.6 installed on my Fedora Core 6 server (with all the latest updates installed) and Plesk v8.2.1. It doesn't look like PHP CLI was installed by my hosting company. It's a dedicated, remote server.

What's the quickest / easiest way to get PHP CLI shoehorned in?

Thank you in advance.

open4biz
12th October 2007, 06:43 PM
rpm -Uvh php-common-5.1.6-3.7.fc6.ppc.rpm
/etc/selinux/targeted/contexts/files/file_contexts: Multiple same specifications for /usr/local/sitebuilder/tmp(/.*)?.
Preparing... ########################################### [100%]
package php-common-5.1.6-3.7.fc6 is intended for a ppc architecture
package php-common-5.1.6-3.7.fc6 is already installed
[root]#
[root]# rpm -ivh php-cli-5.1.6-3.7.fc6.ppc.rpm
/etc/selinux/targeted/contexts/files/file_contexts: Multiple same specifications for /usr/local/sitebuilder/tmp(/.*)?.
Preparing... ########################################### [100%]
package php-cli-5.1.6-3.7.fc6 is intended for a ppc architecture
package php-cli-5.1.6-3.7.fc6 is already installed
file /usr/bin/php from install of php-cli-5.1.6-3.7.fc6 conflicts with file from package php-cli-5.1.6-3.7.fc6
file /usr/bin/php-cgi from install of php-cli-5.1.6-3.7.fc6 conflicts with file from package php-cli-5.1.6-3.7.fc6

According to the text above, it would seem PHP CLI is already installed... but why can't my PHP install script find it? Here's the result from the install script:


The PHP CLI version could not be found. This will prevent you from using the scanner function, cron, and may limit some of the other software functions

Do I have to tweak a configuration file or something?

DamianS
14th October 2007, 04:13 PM
That PHP-CLI is worthless, since php5 already comes with a commandline interface.
Have you tried running php -v in a terminal?

If your script cant find it, you will need to put the path of your php binary into your shell.

open4biz
15th October 2007, 01:36 AM
If your script cant find it, you will need to put the path of your php binary into your shell.

How do I do that?

DamianS
15th October 2007, 06:51 AM
Depends upon which shell you're using.
echo $SHELL
will tell you the shell.
I'll asume it is bash, since it is the most common, and default with RedHat and most other Linux distros.
First, check out your current settings by
env
and look for the PATH= settings which will tell you the directories the shell will look for, when running commands.
I'm too lazy to look in my FC6 setups, but php is installed in /usr/bin on my F7 machine.
So first try running php with /usr/bin/php -v
If this works, add the /usr/bin and several other dirs such as /usr/local/bin to your PATH env variable by doing
export PATH=$PATH:/usr/bin/:/usr/local/bin

But these dirs should be in your PATH var by default, so either you have fscked something up, or your server has been locked down by the hosting company.

DamianS
15th October 2007, 07:02 AM
Forgot to add:
If your paths are screwed up, the above commands may not work.
In which modify them as such:
/bin/echo $SHELL
/bin/env

and you might need to add the /bin and /home/yourusername/bin dirs to the PATH var