[San-Diego-pm] Running PHP slide show from Perl

Joel Fentin joel at fentin.com
Wed Oct 6 11:14:08 PDT 2010


On 10/6/2010 10:46 AM, Nicholas Wehr wrote:
> I'm thinking php doesn't run on the command line by default -
> what's your platform?

I don't know. My client is hosted by Blue Host 
(http://www.bluehost.com/) and is probably on a shared server.

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


-- 
Joel Fentin       tel: 760-749-8863
Biz Website:      http://fentin.com
Personal Website: http://fentin.com/me


More information about the San-Diego-pm mailing list