Visit Jeremy's Blog.
Go Back > Forums > Linux Forums > Linux - Newbie
User Name
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!


  Search this Thread
Old 07-07-2009, 10:00 PM   #1
LQ Newbie
Registered: Mar 2009
Posts: 19

Rep: Reputation: 0
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.
Old 07-07-2009, 10:31 PM   #2
Registered: Apr 2002
Location: in a fallen world
Distribution: slackware by choice, others too :} ... android.
Posts: 23,067
Blog Entries: 11

Rep: Reputation: 910Reputation: 910Reputation: 910Reputation: 910Reputation: 910Reputation: 910Reputation: 910Reputation: 910
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?

Old 07-07-2009, 10:43 PM   #3
Registered: Feb 2006
Distribution: Debian Sid
Posts: 665

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

tuananh87vn try this command:
 $: 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
Old 07-07-2009, 10:48 PM   #4
LQ Newbie
Registered: Mar 2009
Posts: 19

Original Poster
Rep: Reputation: 0
yayy, php5-cli, i missed this one


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Using cron to run PHP script GavB Linux - General 7 03-06-2009 12:36 PM
run php script from command line blizunt7 Programming 11 11-06-2008 11:59 AM
Using PHP to run a script on another server qscomputing Programming 4 04-12-2006 10:49 AM
cannot get tu run a php script in cron alain Linux - General 6 02-06-2006 02:54 AM
How do I run a PHP script as a service? robbiemorgan Linux - Newbie 3 04-13-2005 02:03 PM > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 02:21 AM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration