homepage Welcome to WebmasterWorld Guest from 54.205.122.62
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 extensions.....
a little help...please
Bluetuna

10+ Year Member



 
Msg#: 1165 posted 2:20 am on Sep 9, 2002 (gmt 0)

I am sure this is very easy and I am new to php so a little help would be great. My web host currently runs php scripts with the extension .php3. If I try a scripts with .php I just see text. I have no access to the httpd.conf file but I am allowed to use .htaccess. I don't know exactly what to write in the .htaccess file. Also, should I place the .htaccess file in the folder of the scripts or the www/ folder? Any help would be great. Thank you.

 

Bluetuna

10+ Year Member



 
Msg#: 1165 posted 3:13 am on Sep 9, 2002 (gmt 0)

This is what I have found in my endless search for an answer, to put this in the .htaccess:

AddType application/x-httpd-php3 .php

When I put that in, the browser asks me what application I want to use to because it does not know what to do. Thanks again!

Knowles

10+ Year Member



 
Msg#: 1165 posted 3:51 am on Sep 9, 2002 (gmt 0)

Bluetuna, I think the problem you are running into is that they are running PHP3 I dont believe there is going to be a way to get it to run php I think it has to be php3 or phtml. I may be wrong I am sure someone will correct me if I am.

ergophobe

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



 
Msg#: 1165 posted 5:58 pm on Sep 9, 2002 (gmt 0)

Knowles is wrong. *.php3 is simply a default and it makes no difference whether your extensions are php3, php, html, or *.gadzooks as long as you have everything set up correctly.

I suspect that what is happening, however, is that your host limits the control you have over with PHP or .htaccess or both. I ran into this with a host that used, of all things, *.php4 as the default extension for php4 and would not allow any user control.

If that's the case, your best bet will probably be to grep for .php and change it to .php3. This worked in my case (php => ph4). The problem in your case, however, is that many scripts have features that are only available in php4 and so they will not run under php3 no matter what you call them. You will get constant "undefined function" errors when you run the script".

Tom

dhdweb

10+ Year Member



 
Msg#: 1165 posted 9:29 pm on Sep 9, 2002 (gmt 0)

Just name the files .php3, test, if it works go with it.
I had to do this untill my host upgraded to PHP 4.

<side note>When searching for premade scripts they will say what version of PHP they are writen for.</side note>

ergophobe

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



 
Msg#: 1165 posted 11:55 pm on Sep 9, 2002 (gmt 0)


Just name the files .php3, test, if it works go with it.

That works if there are no includes/requires. When I said to grep for .php, I was referring to things like that. You need to both change the file names and grep for includes and requires.

Tom

Knowles

10+ Year Member



 
Msg#: 1165 posted 12:53 am on Sep 10, 2002 (gmt 0)

See told ya somone would correct me ;) Thanks guys. Guess thats what I get for never working with PHP3.

Bluetuna

10+ Year Member



 
Msg#: 1165 posted 3:12 am on Sep 10, 2002 (gmt 0)

I have called my web host and they say I can use .htaccess but they wont give me any support. Any script with the .php extension will not work, even if it did previously with the .php3 extension. I have read a lot about .htaccess, but like I said, when I try it the browsers want to download the page. Thank you all for your help and input so far. If there are any php or .htaccess masters out here please speak up. Thanks again.

ergophobe

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



 
Msg#: 1165 posted 5:27 pm on Sep 10, 2002 (gmt 0)


AddType application/x-httpd-php3 .php

That should work. I don't know why it doesn't. It is definitely the command you need.

You can see the Apache Manual Entry on AddType [httpd.apache.org] if you want, but that shoudl definitely work.

Just to verify, if you create a php3 script and name it file.php3, does it run?

Tom

andreasfriedrich

WebmasterWorld Senior Member 10+ Year Member



 
Msg#: 1165 posted 7:03 pm on Sep 10, 2002 (gmt 0)

AddType application/x-httpd-php3 .php

That should work

... depending on the AllowOverride [httpd.apache.org] setting. You need to have at least FileInfo privileges for the directory the .htaccess file is in or in one of its parents directories.

ergophobe

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



 
Msg#: 1165 posted 7:10 pm on Sep 10, 2002 (gmt 0)

I thought his hosting service said he had necessary privileges, but in fact they just said he could edit his .htaccess, which is sort of non-information.

Do you whether he can get info about his privileges from the server? I'm assuming not, otherwise it would probably be shown via phpinfo().

Tom

andreasfriedrich

WebmasterWorld Senior Member 10+ Year Member



 
Msg#: 1165 posted 7:18 pm on Sep 10, 2002 (gmt 0)

in fact they just said he could edit his .htaccess

Thatīs right. They just said you can use it all you want. They never said it will work.

I donīt know, but Iīm assuming there is no way. It might be considered a security problem if everybody could access the server configuration beyond the data displayed by phpinfo.

Bluetuna

10+ Year Member



 
Msg#: 1165 posted 5:10 am on Sep 11, 2002 (gmt 0)

Well, I found the anwser in the form of technical support for anyone following:

"Your Web Hosting Site supports both versions 2.x and 3.x of PHP. Your PHP scripts are denoted by their extension, either .phtml or .php3. PHP files using the extension .phtml will be interpreted by PHP 2.0. PHP files using the extension .php3 will be interpreted by PHP 3.0. PHP 2.x is supported only for backward compatibility for customers who already use it, and will be phased out at some point in the future. We strongly recommend that new customers use version 3.0 (.php3)."

Thanks for all your input, time to look for a new host!

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