473,383 Members | 1,832 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.

running php scripts from the command line in 4.2.3


I'm helping someone who is running a server with Debian testing, which
only has PHP 4.2.3, not higher. He wants to run php from the command
line, which I think is only supported starting with 4.3. Is there a
way to do it with 4.2.3 ? I am trying to avoid installing a newer
version of php from source, as the machine has a running webserver on
it that I would not like to break for more than a few minutes.

--Rob
Jul 17 '05 #1
3 1985
Rob Ristroph wrote:
I'm helping someone who is running a server with Debian testing, which
only has PHP 4.2.3, not higher. He wants to run php from the command
line, which I think is only supported starting with 4.3. Is there a
way to do it with 4.2.3 ? I am trying to avoid installing a newer
version of php from source, as the machine has a running webserver on
it that I would not like to break for more than a few minutes.


Maybe this works in testing too. I used it in unstable

root# apt-get install php4-cgi
--
--= my mail box only accepts =--
--= Content-Type: text/plain =--
--= Size below 10001 bytes =--
Jul 17 '05 #2
"Rob Ristroph" <rg*@sdf.lonestar.org> wrote in message
news:87************@rgristroph-austin.ath.cx...

I'm helping someone who is running a server with Debian testing, which
only has PHP 4.2.3, not higher. He wants to run php from the command
line, which I think is only supported starting with 4.3. Is there a
way to do it with 4.2.3 ? I am trying to avoid installing a newer
version of php from source, as the machine has a running webserver on
it that I would not like to break for more than a few minutes.

--Rob


just type :
php filename.php

or make it into a shell script add the first line to the script
#!/bin/php -q

then chmod 755 the file

the to run it ./filename.php

or stick a copy in

/usr/bin

btw, if you are making a shell script, it does not
need the .php extention. it doesnt need one at all

I have a shell script that I wrote in php called srestart
it restarts services properly on my boxes.

ie:
srestart httpd
srestart mail
srestart dns
--
Mike Bradley
http://www.gzentools.com -- free online php tools
Jul 17 '05 #3
>>>>> "Pedro" == Pedro Graca <he****@hotpop.com> writes:
Pedro>
Pedro> Rob Ristroph wrote:
I'm helping someone who is running a server with Debian testing,
which only has PHP 4.2.3, not higher. He wants to run php from the
command line, which I think is only supported starting with 4.3.
Is there a way to do it with 4.2.3 ? I am trying to avoid
installing a newer version of php from source, as the machine has a
running webserver on it that I would not like to break for more
than a few minutes.

Pedro>
Pedro> Maybe this works in testing too. I used it in unstable
Pedro>
Pedro> root# apt-get install php4-cgi

This is exactly what I needed to do. Thank you very much.

--Rob
Jul 17 '05 #4

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

Similar topics

8
by: Sticks | last post by:
ok... im not quite sure how to describe my problem. i have a php script that runs through my entire php site and writes the resulting output to html files. this is necessary as the nature of the...
9
by: Jeff Wagner | last post by:
I have a project of converting numerous DOS cmd shell scripts to Python. Is there a tutorial to getting started? Thanks, Jeff
1
by: sub1ime_uk | last post by:
I apologise if this is a well known problem. I've searched and can't find a clear description or fix. Hope someone can help. I am running my Python scripts under Windows 2000 using Python 2.4...
0
by: paulhjwu | last post by:
Hi, I have problems running a couple of shell scripts from PHP. I found a similar posting, so I posted my question to the original author. But unfortunately the original author is not at the...
1
by: edovale | last post by:
Hi there, I am trying to create a db on db2 and when running the scripts, which have been successfully ran before, I get the following error: DB21034E The command was processed as an SQL...
13
by: wattersmt | last post by:
Hello, I am trying to write a python cgi that calls a script over ssh, the problem is the script takes a very long time to execute so Apache makes the CGI time out and I never see any output. ...
24
by: Mark | last post by:
Hi, I'm new to python and looking for a better idiom to use for the manner I have been organising my python scripts. I've googled all over the place about this but found absolutely nothing. I'm...
51
by: Ojas | last post by:
Hi!, I just out of curiosity want to know how top detect the client side application under which the script is getting run. I mean to ask the how to know whether the script is running under...
22
by: V S Rawat | last post by:
(bringing the discussion here for php.general) I am on xpsp3, wampserver 2.0, having apache 2.2.8, php 5.2.6, MySQL 5.0.51b. http://localhost/ is E:\wamp\www\ I have put the first php script...
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
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: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
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.