473,597 Members | 2,074 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 2003
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.lonest ar.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
3312
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 hosting available to me for this particular page prohibits me from using php/mysql as i would like. my script works simply by using output buffers and an include the relevant section of code is as follows: ob_start();
9
3649
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
1693
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 Build 243 from Activestate. If I want to specify a file as standard input to my script I can just enter a command like: H:\> pyscript.py file.inp
0
1687
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 address anymore. Anyone can help with the problems highlghted below?
1
1873
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 statement because it was not a valid Command Line Processor command. During SQL processing it returned: SQL1224N A database agent could not be started to service a request, or was
13
5991
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. The script is set to print a progress report to stdout every 3 seconds but I never see any output until the child process is killed. Here's what I have in my python script:
24
2827
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 a linux/unix command line guy quite experienced in shell scripts etc. I have a heap of command line utility scripts which I run directly. What is the best way to create python command line scripts but exploit the (loadonly) speed-up benefit of...
51
4118
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 Command Prompt or Browser or some other application? Ojas.
22
3808
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 to hello.php file: <html> <head> <title>PHP Test</title>
0
7965
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8270
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
8029
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8258
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
6683
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
5845
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 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 a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5423
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
3880
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
3922
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?

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.