|
Posted by Erwin Moller on 08/28/06 11:07
Hot cat wrote:
> Howdy all,
>
> I just installed php 5 in fedora core 4 and have just written a the first
> scrip[t that comes in the "man php" (echo "hello world") from the command
> line.
>
> I tried to execute
> #!/bin/php
> <?php
> print ("hello world");
> ?>
Hi Hotcat,
When you say you 'installed php' does that mean you set up PHP so it is
intergrated in apache?
Because the example you give is CGI-like call to PHP.
Not many use PHP that way. I am even uncertain if that still works..
So unless you have some exotic setup for some reason, start using PHP via
your browser.
A typical PHP file does NOT contain the bash instruction #!/bin/php.
It starts like this:
<?php
phpinfo();
?>
and you call it via your webbrowser:
http://localhost/myphptest.php
Or if you call it via commandline:
/pathtophp/php myTest.php
Hope that helps.
If it does not, come back here.
Regards,
Erwin Moller
>
> I get bash errors and it won't run.
> Same when I tried to place a few simple "hello worlds" in a piece
> of html that I \itried to run on Friefox. Whats the story do I have to
> fiddle with php.ini, install a plug in for Friefox?
>
> TIA
[Back to original message]
|