|
Posted by Erwin Moller on 08/28/06 12:18
Hot cat wrote:
> On Mon, 28 Aug 2006 13:07:57 +0200, Erwin Moller wrote:
>
>> 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?
>
> Apache? I've just got Firefox set up so far. Guess I need to set up an
> Apache server then?
I expect you want to use PHP for serving webpages to a client.
That is what almost everybody uses it for.
If so: Yes, you need Apache. At least that is the most sensible setup on
Fedora in my humble opinion.
In case you want to use PHP for something else, like some serverside job, I
think you have better options that PHP, like Phyton, Java, Perl, maybe
plain BASH programming. Depends on the job of course.
But PHP can be used too.
>> 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.
> http://localhost/myphptest.php
> didn't work "the connection was refused when connecting to local host".
Well, did you read the fine manual when you installed PHP?
It can be found here:
http://nl3.php.net/manual/en/install.php
Be sure you read all relevant pages in chapter II (2).
Also scan through the usercontributed notes, they are very valuable in case
of problems.
>
>>
>> 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.
>>
>
> I'm baa-ack!
LOL. :P
Best of luck!
Start with digesting the Installdocumentation.
It is not much.
Regards,
Erwin Moller
>> 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]
|