Welcome to WebmasterWorld Guest from 184.72.177.182

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)

Junior Member

10+ Year Member

joined:Aug 8, 2005
posts:122
votes: 0



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)

Senior Member

WebmasterWorld Senior Member 10+ Year Member

joined:Sept 7, 2003
posts:1404
votes: 0


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)

Junior Member

10+ Year Member

joined:Aug 8, 2005
posts:122
votes: 0


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)

Administrator

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

joined:July 31, 2003
posts:12533
votes: 0


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)

Junior Member

10+ Year Member

joined:Aug 8, 2005
posts:122
votes: 0


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

Administrator

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

joined:July 31, 2003
posts:12533
votes: 0


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)

Junior Member

10+ Year Member

joined:Aug 8, 2005
posts:122
votes: 0


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)

Junior Member

10+ Year Member

joined:Aug 8, 2005
posts:122
votes: 0


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)

Administrator

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

joined:July 31, 2003
posts:12533
votes: 0


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).

 

Join The Conversation

Moderators and Top Contributors

Hot Threads This Week

Featured Threads

Free SEO Tools

Hire Expert Members