php-install Digest 20 Jan 2002 04:53:04 -0000 Issue 658

Topics (messages 5627 through 5628):

Re: php 4.1.1 RH 7.2 apache 1.3.20 problem HELP!
        5627 by: Chris

PHP path shown on browser
        5628 by: Tony

Administrivia:

To subscribe to the digest, e-mail:
        [EMAIL PROTECTED]

To unsubscribe from the digest, e-mail:
        [EMAIL PROTECTED]

To post to the list, e-mail:
        [EMAIL PROTECTED]


----------------------------------------------------------------------
--- Begin Message ---
Greetings,
 I won't swear to it but the issue you're having *might* be syntax related.
Secondly, you seem to be missing a reference to a vital file in your httpd.conf
file. The file I'm referring to is mod_php4.c. Following, a small portion
of the pertinent section:
---------8<----[snip]-------------
AddModule mod_unique_id.c
AddModule mod_so.c
AddModule mod_setenvif.c
AddModule mod_php4.c
AddModule mod_gzip.c
AddModule apache_ssl.c
---------8<----[snip]-------------

Is the file listed in *your* httpd.conf file and if so, do you have it *and*
does Apache know where it is?

Next, about the "syntax" issue. You list the extentions all together on one line
in your httpd.conf file. I've never seen this done *or* suggested. They have all
had the following format:
---------8<----[snip]-------------
    # For example, the PHP 3.x module (not part of the Apache distribution - see
    # http://www.php.net) will typically use:
    #

   AddType application/x-httpd-php3 .php3
   AddType application/x-httpd-php3-source .phps

    #
    # And for PHP 4.x, use:
    #

   AddType application/x-httpd-php .php
   AddType application/x-httpd-php .php4
   AddType application/x-httpd-php-source .phps
---------8<----[snip]-------------

It *does* seem as tho your style would work but as you're having trouble, I thought
I'd suggest the more "conventional" style.

Best Wishes,
 Chris

> I've compiled php (dso) with apache, just fine, and have confirmed that I have
> all of the needed lines in my httpd.conf. When I try to open a test php page on
> the server and another computer, all i see is code. I know httpd is correct, as
> it works fine for my RT/mysql installation. I have tried every bit of advice that
> I've seen on the net to no avail. I followed the "INSTALL" instructions for dso
> but I cannot get apache to show .php files correctly. After 2 WEEKS of
> troubleshooting, I AM READY TO PULL MY HAIR OUT! Any help would be GREATLY
> appreciated!
>
> **less httpd.conf | grep php:**
>
> ___________________________________________
> LoadModule php_module         modules/mod_php.so
> #LoadModule php3_module        modules/libphp3.so
> LoadModule php4_module        modules/libphp4.so
> LoadModule php4_module        lib/apache/libphp4.so
> AddModule mod_php.c
> #AddModule mod_php3.c
> AddModule mod_php4.c
>    DirectoryIndex index.html index.htm index.shtml index.php index.php4
> index.php3 index.phtml index.cgi
>    # http://www.php.net) will typically use:
>    #<IfModule mod_php3.c>
>    #    AddType application/x-httpd-php3 .php3
>    #    AddType application/x-httpd-php3-source .phps
>    <IfModule mod_php4.c>
>        AddType application/x-httpd-php .php .php4 .php3 .phtml
>        AddType application/x-httpd-php-source .phps
>    <IfModule mod_php.c>
>        AddType application/x-httpd-php .phtml
> _________________________________________________
>
> _______________________________________________
>
> **"INSTALL" instructions with php 4.1.1. I have followed all
> religiously:
>
>
> QUICK INSTALL (DSO)
>
> For this to work your Apache httpd must have mod_so enabled.
> Check using httpd -l.  You should see something like:
>
> Compiled-in modules:
>  http_core.c
>  mod_so.c
>
> Chances are you will see a lot more modules than these two. That's ok,  as long
> as mod_so.c shows up you can proceed with the following steps:
>
> $ gunzip -c php-4.0.x.tar.gz | tar xf -
> $ cd php-4.0.x
> $ ./configure --with-mysql --with-apxs
> $ make
> $ make install
>
> If you get an error telling you that the apxs script could not be found, look for
> it on your system and if you find it, provide the full path to it
> as: --with-apxs=/path/to/apxs
>
> Next you must copy php.ini-dist to the appropriate place (normally
> /usr/local/lib/php.ini) and edit it as necessary to set PHP options.
>
> The only thing left to do is to edit your httpd.conf file and make sure the
> PHP 4 mime type is there and uncommented.  You need a line that looks like
> this:
>
>   AddType application/x-httpd-php .php
>
> Then restart your server (apachectl restart) and you should be able to serve up
> PHP files now.  Make a test file called test.php and put some  PHP tags in it.
> Like <?phpinfo()?>, for example
> _________________________________________________________
>
>
>
> --
> Eric J. Gould
> Sr. Computer Specialist
> CAUP, UofW
> 206-616-2487
>
> --
> PHP Install 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]


..


............................................
This email was sent using DNSWATCH WebMail.
   "Get YOUR account today!"
http://www.dnswatch.com/dnswm112/


--- End Message ---
--- Begin Message ---
Hi all,

I got a problem when i run php as a CGI binary.
I wrote a php script as follow

#!/usr/local/bin/php
<?
print "Hello World";
?>

however, i got  the following result when i called it from browser

#!/usr/local/bin/php
Hello World

The path of PHP is always shown at the top of the browser.

Does anyone know the solution?

Thanks
    Tony.



--- End Message ---

Reply via email to