run php on a script, from a script
I would like to know if the following is possible and how to do it:
I have a "template" .php file on my server, say template.php.
It contains some PHP instructions and some HTML
I also have a script, script.php
When script.php runs, I want it to run php on template.php, and write
the resulting html output to a file.
I need to say something like:
runphp ( 'template.php', 'htmloutput.html' );
and obtain a file, htmloutput.html, with the result of php having run
template.php (hope I'm being clear).
The problem is, of course, that the runphp function doesn't exist so
what is the way to do it?
"Fred Paris" <email@example.com> wrote in message
> I would like to know if the following is possible and how to do it:
> I have a "template" .php file on my server, say template.php.
> It contains some PHP instructions and some HTML
> I also have a script, script.php
> When script.php runs, I want it to run php on template.php, and write
> the resulting html output to a file.
> I need to say something like:
> runphp ( 'template.php', 'htmloutput.html' );
> and obtain a file, htmloutput.html, with the result of php having run
> template.php (hope I'm being clear).
> The...PHP CGI script to PHP CLI script
This is my problem:
I'm using PEAR package Spreadsheet_Excel_Writer to generate Excel
files. Everything works fine on my test server and several production
servers. But on one production server, generated Excel won't open (and
data is actually in it).
I can't figure out what's causing the problem (only difference is PHP
version 5.1.6 vs 5.2, other required PEAR packages are identical), but
I did notice during my investigation that Excel file generates and
opens without problem if I execute script from command line (I use
dummy PHP script with basic things needed to m...Will Old PHP scripts Run on New PHP?
Does old PHP scripts forwards compatible with newer PHP release?
> Does old PHP scripts forwards compatible with newer PHP release?
that really depends on many things for example the set up of php, which
functions are used etc
Deal Finder <firstname.lastname@example.org> wrote or quoted:
> Does old PHP scripts forwards compatible with newer PHP release?
Not in general. My experience has been that changing PHP versions
often casues headaches, if it hasn't been well planned for in advance.
The problems are usually easy to fix, but it can still be a lot more
painful than is desirable.
...PHP Training Institute In Delhi, Live Projects on PHP. Short Term PHP Courses, PHP Scripts, PHP Training with Live Projects.
Vserve Global offers short term PHP: Hypertext Preprocessor Training
Course, which is a widely used, general-purpose scripting language
that was originally designed for web development, to produce dynamic
web pages. It can be embedded into HTML and generally runs on a web
server, which needs to be configured to process PHP code and create
web page content from it. It can be deployed on most web servers and
on almost every operating system and platform free of charge.PHP is
installed on over 20 million websites and 1 million web servers.
>> Core PHP Language
>> HTML, Cascad...a PHP script works fine when called from the browser but not as a shell script
I've got a script called makeRss.php. It works fine if I try to open it
with my browser. It makes an RSS feed for every page on my site. You
can see it working here:
It does just what I want it to do.
However, I need for this script to get called every 15 minutes. So I
set it up as a cron job. And cron doesn't like calling this thing. Cron
is nice enough to send me an email with an error message. Every 15
minutes I get this:
/home/httpd/vhosts/autostratus.com/httpdocs/makeRss.php: line 1: ?php:
No such file
/home/httpd/vhosts/autostratus.com/httpdocs/makeRss.php: line 2: syntax
unexpected token `"tagIndexLibrary.php"'
/home/httpd/vhosts/autostratus.com/httpdocs/makeRss.php: line 2:
Why would cron have a problem if the script works fine from the web
On 21 Dec 2005 09:06:53 -0800, "lawrence k" <email@example.com> wrote:
>I've got a script called makeRss.php. It works fine if I try to open it
>with my browser. It makes an RSS feed for every page on my site. You
>can see it working here:
>It does just what I want it to do.
>However, I need for this script to get called every 15 minutes. So I
>set it up as a cron job. And cron doesn't like calling this thing. Cron
>is nice enough to send me an ema...run a script from php..
I would like to run a custom script on a linux box via a button on a php
page (php webpage hosted on the same linux box).
Is this possible? If so , can you give me a pointer in the right direction?
Do you mean run a custom script inside the browser's environment as the
browser's user rather than the web server's environment as the web
Do you mean click a button in the browser window, but don't post that
page to the web server, but have the web server run a script anyway?
If it is the second one, you can do something ...shell script + php
I'm writing a shell script and inside of it I have variable that I
want to pass to php, but for some reason it isn't working... can
someone help me? here is example
php -r 'geoip_country_name_by_name($i);'
php part works in shell if i use actual value from variable and not
> I'm writing a shell script and inside of it I have variable that I
> want to pass to php, but for some reason it isn't working... can
> someone help me? here is example
> php -r 'geoip_country_name_by_name($i);'
In bash, single quotes mean "do not parse variables". Try double quotes.
Also, PHP require quotes around strings.
-- http://alvaro.es - �lvaro G. Vicario - Burgos, Spain
-- Mi sitio sobre programaci�n web: http://bits.demogracia.com
-- Mi web de humor al ba�o Mar�a: http://www.demogracia.com
=C3=81lvaro G. Vicario wrote:
> alexus escribi=EF=BF=BD:
> > I'm writing a shell script and inside of it I have variable that I
> > want to pass to php, but for some reason it isn't working... can
> > someone help me? here is example
> > #!/bin/sh
> > i=3D127.0.0.1
> > php -r 'geoip_country_name_by_name($i);'
> In bash, single quotes mean "do not parse variables". Try double quotes.
> Also, PHP require quotes around strings....why does it not get the value in perl run shell script to call include php file?
two file in the same folder
$i = 0;
$decryptCC = `echo '<?php include( "/home/webserve.ca/eselect/
eselect_test/fun.php" ); echo "CC" . dcc( "$i", "" ) . "CC"; ?>' | php
run ./1.sh get test.
2. run ....Spawning sub php scripts in a master script
Currently designing a web crawler of sorts to download some XML feeds and
parse the data, was hoping to get it working in shared hosting
environments. Because it only scans slowly and is designed to use limited
resources, it shouldn't cause any problems or raise flags. The one issue
I am running up against is script max execution time.
Is there any way to spawn another instance of the script and close the
initial one, daisy chaining execution every few minutes to stay under the
limits? I'm unclear whether options like popen() a) work in shared
environments and b) allow the process which spawns another to be shut
If anyone has any expertise here I'd absolutely love some direction!
On Wed, 14 Nov 2007 20:34:27 +0000, kiretose wrote:
> Hey guys,
> Currently designing a web crawler of sorts to download some XML feeds
> and parse the data, was hoping to get it working in shared hosting
> environments. Because it only scans slowly and is designed to use
> limited resources, it shouldn't cause any problems or raise flags. The
> one issue I am running up against is script max execution time.
> Is there any way to spawn another instance of the script and close the
> initial one, daisy chaining execution every few minutes to stay under
> the limits? I'm unclear whether options like popen() a) work in shared
> environments and b) allow the process which spawns another to be shut
> dow...Calling (non-php) scripts from inside PHP
In my php page I am calling a Python cgi. The problem is that
originally the Python script was being called directly and it could
access the environment variables that were being set. Now since the
php script is being called first it has access to the environment
variables, but the Python script does nt.
How can I forward the variables or call the Python script in such a
way where it can access those variables?
These are the type of environment variables I am talking about
In my php script (which is a web page) I was calling the Python cgi
$output=shell_exec("../cgi-bin/setaccess.cgi"." 2>&1"); //system call
Greetings, Anthony Smith.
In reply to Your message dated Wednesday, December 12, 2007, 22:30:55,
> In my php page I am calling a Python cgi. The problem is that
> originally the Python script was being called directly and it could
> access the environment variables that were being set. Now since the
> php script is being called first it has access to the environment
> variables, but the Python script does nt.
> How can I forward the variables or call the Python script in such a
> way where it can access those variables?
> These are the type of environment variables I am talking about
> In my php script (which is a web page) I was calling the Python cgi
> like this.
> $output=shell_exec(".....call perl script from within a php script
I want to call a perl script from within a php script. I have tried
system() and exec() commands but i'm never getting any output. The
script works fine on the shell tho... :(
What I've tried:
// Outputs all the result of shellcommand "ls", and returns
// the last output line into $last_line. Stores the return value
// of the shell command in $retval.
//$last_line = system('ls -la'/*'./TSPtest.pl'*/, $retval);
$last_line = exec(TSPtest.pl, $retval);
echo "len: " . strlen($last_line) . &q...what is wrong with this script and how do I get the value in a php script
what is wrong with this script and how do I get the value Rij1 and Rij2 and Rij3 and Rij4 and Rij5 and Rij6 in a php script
import RPi.GPIO as GPIO
Rij1 = 0
Rij2 = 0
Rij3 = 0
Rij4 = 0
Rij5 = 0
Rij6 = 0
PRij1 = GPIO.input(17)
PRij2 = GPIO.input(18)
PRij3 = GPIO.input(21)
PRij4 = GPIO.input(22)
PRij5 = GPIO.input(23)
PRij6 = GPIO.input(24)
if (PRij1 == False):
Rij1 = Rij1...Script to run a script
I can capture the script that is running [get(scriptname)] into feld old
how can i re-run this script again from this information... like can I run
script [calculated result [field(old script)]
s/v Island Time (352#277)
In article <5FBPg.13765$xQ1.firstname.lastname@example.org>,
"Guy" <email@example.com> wrote:
> I can capture the script that is running [get(scriptname)] into feld old
> how can i re-run this script aga...execute a shell script in a shell script
I have been stumbled on this issue, please see below. I am unable to
execute a shell script in a shell script.
I need to use perl script but not others and have tried eval, -exec
and other on perl script but failed.
system"cleartool setview -exec \"cleartool describe -fmt 'On %Sd
modified %En and comment:\n %c\n\n' /myproject/vob/myprogram.C\"
On Dec 3, 8:30 am, moongeegee <moongee...@gmail.com> wrote:
> Please help.
> I have been stumbled on this issue, please see below. I am unable to
> execute a shell script in a shel...running php scripts from a CD
is there a way to run PHP scripted pages from a CD on a machine that doesnt
have internet access ??
can some sort of fake server be setup ??
The only thing I'm aware of:
i did something like that once, but it's a while ago. I used some
installer-creator-program-thingy to create an install.exe that whould
install apache and mysql service (in the background =D) and php, insert
the content to the database and copy the php files to htdocs dir, and
than created some shortcuts. This was on a windows machi...Run PHP-Script in Background
I am using php 5.0.4 under IIS 6 under Windows Server 2003 and want to
run a php-script as a separate process. This schript dies not have any
output. I tried several variants without success:
exec("c/php5/php.exe path/to/script parameters &") will run the schript
but will wait until the schript finished processing.
exec("c/php5/php.exe path/to/script parameters > null &") gives me the
error message "The specified CGI application exceeded the allowed time
for processing. The server has deleted the process."
Dealing with other variants of php cli procesors like php-win.exe gave
the same result. Also trying to use the start command did not help. My
head is burned out, what else could run my script under this
Thanks for any ideas.
Do you need your script to run constantly? Or should it run only once
after x-many days/hours/minutes?
I had a similar task to do in a W2K environment. I wrote a master PHP
script with set timings on when to run each secondary script bazed on
time of day. Then I just put that mster script in the Windows
scheduler so it runs every hour... That did my job but I don't know if
that's what you are looking for.
> Do you need your script to run constantly? Or should it run only once
It should run only once, and I need to send a parameter with. It's
actually a script which would run too long to wait on with the browser,
so it would run into the timeout limits. So I could ...Run PHP script from bash
I'm trying to run a PHP file as a shell script (with the regular
/usr/bin/php interpreter). It looks like this:
#!/usr/bin/php -q -d html_errors=0
<? echo "This is a test\n"; ?>
This is the result of the execution:
Error in argument 1, char 3: option not found
Error in argument 1, char 4: option not found -
Error in argument 1, char 3: option not found
I can solve it removing the "-d html_errors=0" part but then I get
HTML-formated errors. I can't find the logic because the option is
definitively accepted if I type it myself:
$ /usr/...when does a PHP script stop running?
Suppose I create dynamic web pages with 3 functions (which call other
functions to make everything happen, but these 3 you might think of as
being the top layer):
Is there any chance that incrementPageViews() will be executed? Or, to
turn that question around, does anyone know a reason why it wouldn't?
Does PHP stop executing when the last of the HTML is sent to the
webbrowser (I've heard both yes and no on this newsgroup and I'm
hoping for a definitive answer).
Okay, now lets suppose that I do this (this is closer...Why is shared host php GID and UID the same in my PHP Script?
I ran this:
$processUser = posix_getpwuid(posix_geteuid());
echo("<pre>"); print_r($processUser); echo("</pre>");
I got this result:
[name] => aremssp
[passwd] => x
[uid] => 2244
[gid] => 2244
[dir] => /home/aremssp
[shell] => /usr/local/cpanel/bin/noshell
Why are the GID and UID the same?
> I ran this:
> $processUser = posix_getpwuid(posix_geteuid());
> echo("<pre>"); print_r($processUser); echo("</pre>");
...Changing a script so it can run alongside another script
The code below runs two scripts.... myfile.js and the add to favorites
These work fine when on the page separately... but together only the
myfile.js script works.
I want to make both work... how is this done?
I would like to have the add to favourites script in a file as myfile.js
is..but am unsure of how to do this,
Thanks for any help!!
//configure the two variables below to match yo...Script Script
Ever want to try a little script to see if it will work
but don't want to go through the hassle of creating a file
with #!/bin/bash at the top and making it executable and
running it as ./script-name and then deleting it or moving
You can use the fc command in bash, but it runs in the
current shell, which can cause real problems, and once
you've done it, if it is more than one line, or you do
anything else in between at the prompt, it's gone. fc
also echos the script, which is really ugly and confusing.
So I wrote this little script which has been tremendously
u...Running PL/SQL scripts from PHP
Is there a way to execute PL/SQL scripts from PHP? I have PL/SQL scripts
that utilizes the DBMS_xxx packages. Is it possible to shell out a command
that will run the PL/SQL?
Dung Nguyen <firstname.lastname@example.org> typed:
> Is there a way to execute PL/SQL scripts from PHP? I have PL/SQL
> scripts that utilizes the DBMS_xxx packages. Is it possible to shell
> out a command that will run the PL/SQL?
Yes. Use the system function. Apache must have permission to run the script.
To verify that...how to enable permissions in htaccsess for php file.php script problems
I am having problems with a ftp to http php scrip: Warning: ftp_get():
open_basedir restriction in effect. File(/ftp_login.html.600490715) is
not within the allowed path(s): (/home:/tmp:/usr) in
/home/jbsmedia/public_html/ftp.php on line 352. when i download files,
when i upload i get Upload failed! Can't create temp file?.
as far as i fuigured i set my ftp file folder cmod 777. then must have
to do somethin to the htaccess file. my host is running a unix appache
i found it has something to do with internal server error 500
and mkdir command=
mkdir /var/tmp/xfers && chmod 1777 /var/tmp/xfers */
can anyone help
sorry type error http to ftp script
Salut tout le monde, je rencontre quelque probl�mes en PHP car je ne
suis pas un pro :-( Je voudrais deux script le premier c'est une page
de contact.htm dans la quelle il y a : nom, pr�nom, adresse, societe,
mail, ville code postal et num tel. D�s le visiteur saisie c donn�es
il une base Mysql(car je travail avec PHP/MYSQL) r�cup�re les donn�es
apr�s avoir �ffectu� une verification de la validation de la forme du
mail(******@***.***). Ainsi une table client est cr�er, et aussi lui
donner la possibilit� de se d�sincrire.
Le deuxi�me une page de parrainage, c-a-d une personne qui d�j�