homepage Welcome to WebmasterWorld Guest from 54.211.230.186
register, free tools, login, search, pro membership, help, library, announcements, recent posts, open posts,
Become a Pro Member
Home / Forums Index / Code, Content, and Presentation / PHP Server Side Scripting
Forum Library, Charter, Moderators: coopster & jatar k

PHP Server Side Scripting Forum

    
PHP and extensions using WAMP
Working with PHP4 extension, using WAMP, images folder
hexdj

5+ Year Member



 
Msg#: 9741 posted 7:23 pm on Aug 18, 2005 (gmt 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...

 

grandpa

WebmasterWorld Senior Member 10+ Year Member



 
Msg#: 9741 posted 7:35 pm on Aug 18, 2005 (gmt 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

hexdj

5+ Year Member



 
Msg#: 9741 posted 7:54 pm on Aug 18, 2005 (gmt 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?

coopster

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



 
Msg#: 9741 posted 8:23 pm on Aug 18, 2005 (gmt 0)

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

AddType application/x-httpd-php .php .php4

hexdj

5+ Year Member



 
Msg#: 9741 posted 8:28 pm on Aug 18, 2005 (gmt 0)

where can I tell that to Apache? is there a config file?

coopster

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



 
Msg#: 9741 posted 8:33 pm on Aug 18, 2005 (gmt 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.

hexdj

5+ Year Member



 
Msg#: 9741 posted 8:40 pm on Aug 18, 2005 (gmt 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?

hexdj

5+ Year Member



 
Msg#: 9741 posted 9:21 pm on Aug 18, 2005 (gmt 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?

coopster

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



 
Msg#: 9741 posted 9:40 pm on Aug 18, 2005 (gmt 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).

Global Options:
 top home search open messages active posts  
 

Home / Forums Index / Code, Content, and Presentation / PHP Server Side Scripting
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Home ¦ Free Tools ¦ Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About ¦ Library ¦ Newsletter
WebmasterWorld is a Developer Shed Community owned by Jim Boykin.
© Webmaster World 1996-2014 all rights reserved