Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum. |
Notices |
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
|
|
04-16-2006, 07:36 PM
|
#1
|
Member
Registered: Apr 2006
Location: Atlanta
Distribution: Centos, knoppix, Fedora, Mepis, Zenwalk, Mint
Posts: 142
Rep:
|
can i run .php trom terminal
i want to know if its posibble to run a php script from terminal or i need to have my browser up
|
|
|
04-16-2006, 08:11 PM
|
#2
|
Member
Registered: Jan 2006
Location: New Zealand
Distribution: Ubuntu 5.10 (Breezy), Debian 3.1 (Sarge)
Posts: 37
Rep:
|
Yes, that is possible. just run
Code:
#php <filename>.php
If the command line interpreter is not installed, do something like (debian based distros)
Code:
#apt-cache search php command line interpreter
which should give you something like
output:
php4-cli - command-line interpreter for the php4 scripting language
php5-cli - command-line interpreter for the php5 scripting language
and install the correct package for your system with
Code:
#apt-get install php4-cli
If you don't have a debian based distro, use the corresponding commands with yum. If you do not have yum or apt-get, get it. Just google for "apt-get install" or "yum install".
Then you can do the above.
|
|
|
04-18-2006, 05:26 PM
|
#3
|
Member
Registered: Apr 2006
Location: Atlanta
Distribution: Centos, knoppix, Fedora, Mepis, Zenwalk, Mint
Posts: 142
Original Poster
Rep:
|
ityped the command in yum and it tells me no match for argument: php5-cli
am runing fedora 4 with php5.
|
|
|
04-18-2006, 05:56 PM
|
#4
|
Senior Member
Registered: Aug 2005
Posts: 1,755
Rep:
|
The regular "php" package comes with the command-line interpreter, so if you have PHP installed then you can run php on the command line.
Last edited by spooon; 04-18-2006 at 05:58 PM.
|
|
|
04-18-2006, 07:09 PM
|
#5
|
LQ Newbie
Registered: Sep 2003
Location: UK
Distribution: FC7
Posts: 27
Rep:
|
Code:
# php -f php-file.php
You can also create php scripts designed to run in the terminal like so:
1) Fire up a text editor and create your file, eg:
PHP Code:
#!/usr/bin/php // ^^ that line tells the command line that the file should be parsed by the php CLI interpreter echo "Hello terminal\n";
2) Give the script execute permissions:
Code:
# chmod +x script.php
3) Execute your script:
Code:
# ./script.php
Hello terminal
This is all assuming you have the CLI version of PHP. FC installs this by default.
|
|
|
04-19-2006, 07:27 AM
|
#6
|
Member
Registered: Apr 2006
Location: Atlanta
Distribution: Centos, knoppix, Fedora, Mepis, Zenwalk, Mint
Posts: 142
Original Poster
Rep:
|
the install command am trying to run wont run from command as the installer reports it cant find folders already in it's directory.Thank you for your help but it seems i will have to try and run it from browser as that is what comes with instructions on installing. by the way the app am trying to install is coppermine.
|
|
|
04-20-2006, 07:54 AM
|
#7
|
Member
Registered: Apr 2006
Location: Atlanta
Distribution: Centos, knoppix, Fedora, Mepis, Zenwalk, Mint
Posts: 142
Original Poster
Rep:
|
solved here's the thread to it thanks everyone for your contributions
http://www.linuxquestions.org/questi...d.php?t=436080
|
|
|
All times are GMT -5. The time now is 03:34 PM.
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|