Hi Sean,

When I run your code on our Linux Mandrake, Apache server (standard PHP4
installation) without the double quotes it gives:
Parse error: parse error, expecting `','' or `';'' in
/home/httpd/html/rudolf/test.php on line 8

With the double quotes I suggested it gives the expected result, so Kelly is
correct thinking that your code does not even get parsed. Why, I've no idea.

Rudolf

-----Original Message-----
From: T.Sean Schulze [mailto:[EMAIL PROTECTED]]
Sent: 13 September 2001 03:32
To: [EMAIL PROTECTED]; [EMAIL PROTECTED]
Subject: Re: [PHP] php4 and apache on SuSE Linux


Kelly Barrett wrote:

> Hi Sean,
> What webserver are you using?  Is it using the Apache module of PHP or the
> CGI version?
> 

I will admit to being a newbie, but I am pretty sure that I am using the 
module version.  My /etc/httpd/httpd.conf file includes these lines:

<IfDefine PHP>
LoadModule php3_module /usr/lib/apache/libphp3.so
</IfDefine>
<IfDefine PHP4>
LoadModule php4_module /usr/lib/apache/libphp4.so
</IfDefine>

and these:

    #
    # AddType allows you to tweak mime.types without actually editing it, 
or to
    # make certain files to be certain types.
    #
    # For example, the PHP 3.x module (not part of the Apache distribution 
- see    # http://www.php.net) will typically use:
    #
    <IfModule mod_php3.c>
    AddType application/x-httpd-php3 .php3
    AddType application/x-httpd-php3-source .phps
    AddType application/x-httpd-php3 .phtml
    </IfModule>
    #
    # And for PHP 4.x, use:
    #
    <IfModule mod_php4.c>
    AddType application/x-httpd-php .php
    AddType application/x-httpd-php .php4
    AddType application/x-httpd-php-source .phps
    </IfModule>

> Perhaps the extension of your file doesn't have the PHP processor
> associated with it (if it is installed as an Apache process)?
> 

See above.

> Maybe you are using the CGI version incorrectly?
> 

I think I am using the module.

> With the command line version, you still need the <?php ?> tags before it
> will process the PHP code.
> 
> e.g.
> #!/usr/bin/php
> 
> <?php
> echo "Hey, I am working fine.";
> ?>
> 
> That should work as you expect.
> 

Thanks for that tip.  That fixed the command line script I was working on.  
Now, if I could get the module working...

I think I just figured it out.  I think the problem was the location of the 
file.  I was trying to open a file in my home directory, not in apache's 
DocumentRoot directory as defined in the httpd.conf file.  Once I moved the 
file there, it ran fine.

Thanks you all for your help.

Cheers,
Sean

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

Reply via email to