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