Welcome to WebmasterWorld Guest from 107.22.87.205

Forum Moderators: coopster & jatar k

Message Too Old, No Replies

PHP and extensions using WAMP

Working with PHP4 extension, using WAMP, images folder

     
7:23 pm on Aug 18, 2005 (gmt 0)

5+ Year Member




My hosting company just told me that in order for me to use php on their server I need to have the .php4 extension in all my php scripts, and otherwise php won't work. I have been using WAMP for a few weeks and it only seems to work with .PHP extension files, I am sure there's a way to make it work with .php4 extensions as well, just need to know how...
7:35 pm on Aug 18, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



I'm going out on a limb here, because I don't this absolutely. But... I think you'll need this line in your httpd.conf file:

LoadModule php4_module /usr/lib/apache/1.3/libphp4.so

7:54 pm on Aug 18, 2005 (gmt 0)

5+ Year Member



that file (libphp4.so) does not seem to be in any folder in my PC? do I need to download it and change the path to wherever I save it to?
8:23 pm on Aug 18, 2005 (gmt 0)

WebmasterWorld Administrator coopster is a WebmasterWorld Top Contributor of All Time 10+ Year Member



You can tell Apache to parse certain extensions as PHP. From the manual pages [php.net] ...

AddType application/x-httpd-php .php .php4
8:28 pm on Aug 18, 2005 (gmt 0)

5+ Year Member



where can I tell that to Apache? is there a config file?
8:33 pm on Aug 18, 2005 (gmt 0)

WebmasterWorld Administrator coopster is a WebmasterWorld Top Contributor of All Time 10+ Year Member



Yes, there is an Apache configuration file, httpd.conf. But, more importantly, if your hosting provider allows per-directory override files (.htaccess) you can drop it into your root of your shared hosting site and you won't have to rename all your extensions to .php4!

Most providers allow this, so check into it.

8:40 pm on Aug 18, 2005 (gmt 0)

5+ Year Member



Indeed my site has .htaccess files in some of the folder and I added the line to the folder that has a phpver.php file but it still won't show anything, what am I doing wrong?
9:21 pm on Aug 18, 2005 (gmt 0)

5+ Year Member



Thanks coopster

I added the line:
AddType application/x-httpd-php .php4 .php

to my httpd.conf file and now it works, just had to flip the .php4 in front of the .php in that line.

I would still like to know how to edit the .htacces file so I can use regular .php files on my site though. Could someone point me in the right direction?

9:40 pm on Aug 18, 2005 (gmt 0)

WebmasterWorld Administrator coopster is a WebmasterWorld Top Contributor of All Time 10+ Year Member



The order doesn't matter. May have been a browser caching issue or something.

Anyway, that is exactly what the AddType [httpd.apache.org] directive does. You should be able to have files with .php or a .php4 extension and PHP should parse them. It all depends on the server configuration. In most cases, the directive shown works just fine. In other installations you may have to use AddHandler (or choose to do so).

 

Featured Threads

Hot Threads This Week

Hot Threads This Month