473,383 Members | 1,958 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,383 software developers and data experts.

PHP executable path help

Hi,

I'm a bit of a newbie, seeking help on how to run a .php from the shell.

I'm running debian, with Apache-ssl which is compiled with mod_php4. PHP
for web sites works great.

However, to run a php script from the shell, do I need to install php
from scratch?

Thanks

Andrew Hearn
Jul 17 '05 #1
4 11921
Andrew Hearn <an*********@yahoo.com> wrote:
I'm a bit of a newbie, seeking help on how to run a .php from the shell.

I'm running debian, with Apache-ssl which is compiled with mod_php4. PHP
for web sites works great.

However, to run a php script from the shell, do I need to install php
from scratch?


No, just install the php-cgi packages (php4-cgi*). This contains
/usr/bin/php4 which you can use to run php scripts. Either use
'php4 /foo/bar.php' or

foo.php:
#!/usr/bin/php4
<?php
echo "Hello world!\n";
?>

--

Daniel Tryba

Jul 17 '05 #2
Daniel Tryba wrote:
Andrew Hearn <an*********@yahoo.com> wrote:
I'm a bit of a newbie, seeking help on how to run a .php from the shell.

I'm running debian, with Apache-ssl which is compiled with mod_php4. PHP
for web sites works great.

However, to run a php script from the shell, do I need to install php
from scratch?

No, just install the php-cgi packages (php4-cgi*). This contains
/usr/bin/php4 which you can use to run php scripts. Either use
'php4 /foo/bar.php' or

foo.php:
#!/usr/bin/php4
<?php
echo "Hello world!\n";
?>


Thanks for the help, this has worked... However I need IMAP support, is
it possible to compile php4-cgi with IMAP support?

Is it as simple as following the instructions at:
http://uk.php.net/manual/en/ref.imap.php

Thank you!

Andrew Hearn.
Jul 17 '05 #3
Andrew Hearn <an*********@yahoo.com> wrote:
I'm running debian, with Apache-ssl which is compiled with mod_php4. PHP
for web sites works great.

However, to run a php script from the shell, do I need to install php
from scratch?


install the php-cgi packages (php4-cgi*)


Thanks for the help, this has worked... However I need IMAP support, is
it possible to compile php4-cgi with IMAP support?


To me it's unclear if you are using the packges from your distribution
or your compiling yourself, but in the first case install php4-imap (and
do a "dpkg -l 'php4*'" to find out what modules are available).

--

Daniel Tryba

Jul 17 '05 #4
Andrew Hearn wrote:

Hi,

I'm a bit of a newbie, seeking help on how to run a .php from the shell.

I'm running debian, with Apache-ssl which is compiled with mod_php4. PHP
for web sites works great.

However, to run a php script from the shell, do I need to install php
from scratch?

Thanks

Andrew Hearn


try "whereis php". It should show you where the executable is.

Regards,
Shawn
--
Shawn Wilson
sh***@glassgiant.com
http://www.glassgiant.com
Jul 17 '05 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: Steven Bethard | last post by:
This has probably been answered before, but my Google skills have failed me so far... Is there an os independent way of checking to see if a particular executable is on the path? Basically what...
4
by: presentt | last post by:
Hello, I'm running Ubuntu Linux 5.04. I just started teaching myself Python today, and have been reading a few things to get started. I came across something in one (namely...
4
by: Caroline | last post by:
I'd like to launch an executable file from a web page. Basically, the user enters seven parameters and then clicks a button to generate a graph. The input is written to a file and then read by...
10
by: FireStarter | last post by:
Guys, How can I get the path to the current executable at run time? I think the VB6 equivalent is App.Path. Thanks for your help. FireStarter
15
by: vishsid3 | last post by:
Hi guys , I am new to this forum . can anybody plz tell me - "how can I run a c executable in some directory ,while the executable is in some other directory " I am new to unix and c ,so any...
28
by: Tim Daneliuk | last post by:
I have a program wherein I want one behavior when a file is set as executable and a different behavior if it is not. Is there a simple way to determine whether a given named file is executable...
7
by: patrik.kahari | last post by:
Is there a c++ function similar to getcwd that does not give you the working directory but the directory or path of the currently running executable? I need this because im porting a game that...
3
by: Jeffrey Froman | last post by:
Hello All, I have two python versions installed, one in /usr/bin, and one in /usr/local/bin. However, when invoking python without a full path, I get the wrong executable with the right...
2
by: NasirMunir | last post by:
I am trying to run an executable using shell. The executable look for certain files in the same directory and then run on those files. My problem: I have created a form which asks from the user to...
9
by: mathieu | last post by:
I'd like to be able to get the path to the current working executable (from inside it). Technically this is easy, I simply have to collapse: getcwd and argv Well argv comes in a little late,...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.