473,698 Members | 2,426 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 2004
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
3319
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
3652
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
1695
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
1697
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
1875
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
5998
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
2833
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
4129
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
3819
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
8675
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
8604
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
9029
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
7729
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
6521
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
4370
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
4619
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3050
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
2331
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.