LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   run php script in debian (https://www.linuxquestions.org/questions/linux-newbie-8/run-php-script-in-debian-738470/)

tuananh87vn 07-07-2009 10:00 PM

run php script in debian
 
i have a php script and i want to run it on debian, by using commandline, not placing into apache web root

i'm using debian 5 lenny, apache2 and php5

as referred from the Internet, people often use "php <file_name.php>" to run a php file. However when i used 'php', it's said 'command not found'. I'm definitely sure that php5's successfully been installed, and I also tested by displaying a php file from localhost.

Tinkster 07-07-2009 10:31 PM

Now I do't use debian or any apt-based OSes atm ... there's a dpkg option
that lists all the files which belong to package. Look through your php5
stuff using that; alternatively (given the way debian breaks packages up
in little, individually installed chunks ...) maybe check whether there's
some PHP packages that may hold the command-line executable that
you didn't install after all?



Cheers,
Tink

norobro 07-07-2009 10:43 PM

You're right Tink. The CLI is in the chunk named, strangely enough, "php5-cli"

tuananh87vn try this command:
Code:

$: aptitude search ~i | grep php5
i  libapache2-mod-php5            - server-side, HTML-embedded scripting langu
i  php5-cgi                                  - server-side, HTML-embedded scripting langu
i  php5-cli                                  - command-line interpreter for the php5 scri
i A php5-common                      - Common files for packages built from the p
i A php5-gd                                - GD module for php5
i A php5-mcrypt                          - MCrypt module for php5
i  php5-mysql                            - MySQL module for php5


tuananh87vn 07-07-2009 10:48 PM

yayy, php5-cli, i missed this one


All times are GMT -5. The time now is 11:54 AM.