LinuxQuestions.org
Support LQ: Use code LQ3 and save $3 on Domain Registration
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
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!

Notices


Reply
  Search this Thread
Old 07-07-2009, 11:00 PM   #1
tuananh87vn
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, 11:31 PM   #2
Tinkster
Moderator
 
Registered: Apr 2002
Location: in a fallen world
Distribution: slackware by choice, others too :} ... android.
Posts: 23,066
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?



Cheers,
Tink
 
Old 07-07-2009, 11:43 PM   #3
norobro
Member
 
Registered: Feb 2006
Distribution: Debian Sid
Posts: 518

Rep: Reputation: 177Reputation: 177
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
 
Old 07-07-2009, 11:48 PM   #4
tuananh87vn
LQ Newbie
 
Registered: Mar 2009
Posts: 19

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


Reply


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 01:36 PM
run php script from command line blizunt7 Programming 11 11-06-2008 12:59 PM
Using PHP to run a script on another server qscomputing Programming 4 04-12-2006 11:49 AM
cannot get tu run a php script in cron alain Linux - General 6 02-06-2006 03:54 AM
How do I run a PHP script as a service? robbiemorgan Linux - Newbie 3 04-13-2005 03:03 PM


All times are GMT -5. The time now is 12:51 PM.

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