I'm thinking php doesn't run on the command line by default - what's your platform?<br><br><div class="gmail_quote">On Wed, Oct 6, 2010 at 10:35 AM, Joel Fentin <span dir="ltr"><<a href="mailto:joel@fentin.com">joel@fentin.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;"><div class="im">On 10/6/2010 10:17 AM, Nicholas Wehr wrote:<br>
> any time I need to change directories for whatever reason - I've<br>
> found that it's best practice to:<br>
><br>
> use strict;<br>
> use File::Basename;<br>
> use File::Spec::Functions;<br>
> use FindBin;<br>
><br>
> also, keep in mind - you didn't check the return value from your<br>
> chdir. I think you'd be better off with absolute paths if you<br>
> could swing it. you also should assume your environment is blanked<br>
> out, so your cgi will not have the environment that apache does,<br>
> per se. with your system call, use absolute paths for the php<br>
> program as well. AND make sure you can run php from the shell. eg.<br>
> system(/usr/bin/php /path/to/file/plant1.php')<br>
><br>
<br></div>
Thank you.<br>
<br>
Does the above assume the program was not found?<br>
<br>
The error messages (two) both refer to code inside plant1.php.<br>
<br>
A more fundamental question: Can you run php from system()?<div class="im"><br>
<br>
><br>
> On Wed, Oct 6, 2010 at 5:45 AM, Joel Fentin <<a href="mailto:joel@fentin.com" target="_blank">joel@fentin.com</a><br></div><div class="im">
> <mailto:<a href="mailto:joel@fentin.com" target="_blank">joel@fentin.com</a>>> wrote:<br>
><br>
> I have been attempting to test/run a slideshow program. The<br>
> program must be run from a Perl program.<br>
><br>
> + First note that plant1.php works. See it here:<br>
> <a href="http://calscape.com/Raja99/plant1.php" target="_blank">http://calscape.com/Raja99/plant1.php</a><br>
><br>
> + I wrote a Perl script to run plant1.php. You can run it at:<br>
> <a href="http://www.calscape.com/cgi-bin/Admin/Raja99A.pl" target="_blank">http://www.calscape.com/cgi-bin/Admin/Raja99A.pl</a>.<br>
> It doesn't work. Note the error message.<br>
><br>
> + The operative code lines:<br>
> print "Content-type: text/html\n\n";<br>
> chdir '../../Raja99/';<br>
> system('./plant1.php');<br>
><br>
><br>
> I hope sombody knows what is happening and can help.<br>
> Thank you.<br>
><br>
> --<br>
> Joel Fentin tel: 760-749-8863<br>
> Biz Website: <a href="http://fentin.com" target="_blank">http://fentin.com</a><br>
> Personal Website: <a href="http://fentin.com/me" target="_blank">http://fentin.com/me</a><br>
> _______________________________________________<br>
> San-Diego-pm mailing list<br></div>
> <a href="mailto:San-Diego-pm@pm.org" target="_blank">San-Diego-pm@pm.org</a> <mailto:<a href="mailto:San-Diego-pm@pm.org" target="_blank">San-Diego-pm@pm.org</a>><div class="im"><br>
> <a href="http://mail.pm.org/mailman/listinfo/san-diego-pm" target="_blank">http://mail.pm.org/mailman/listinfo/san-diego-pm</a><br>
><br>
><br>
<br>
<br></div><div><div></div><div class="h5">
-- <br>
Joel Fentin tel: 760-749-8863<br>
Biz Website: <a href="http://fentin.com" target="_blank">http://fentin.com</a><br>
Personal Website: <a href="http://fentin.com/me" target="_blank">http://fentin.com/me</a><br>
</div></div></blockquote></div><br>