Can't enable old PHP version support via .htaccess

Obtain support and get your questions answered here.

Can't enable old PHP version support via .htaccess

Postby ktulx » Sun May 27, 2012 4:35 pm

Hello!

Due to some issues after the latest PHP update, I wanted to use the 5.3 version. After adding "AddType php53-script .php" line to my .htaccess file, I've got the 500 Internal Server Error. What am I doing wrong?

Thanks.
ktulx
New around here
 
Posts: 24
Joined: Sat Nov 12, 2011 7:37 pm

Re: Can't enable old PHP version support via .htaccess

Postby Max » Mon May 28, 2012 2:01 am

Well if you could please maybe tell me your (cPanel) username and which directory of your account you are doing this in, I might be able to have a look :P
Max
Administrator
 
Posts: 1043
Joined: Sat Jul 18, 2009 3:17 pm

Re: Can't enable old PHP version support via .htaccess

Postby ktulx » Tue May 29, 2012 4:05 pm

Sure, but the point is that I would like to try to understand what's going on :)
I have two small blog engines installed on my account and after the PHP update there are some issues with database connection.
The principal error is
Code: Select all
PHP (8192): mysql_escape_string(): This function is deprecated; use mysql_real_escape_string() instead.

I've followed your guide and recreated all mysql users, but nothing changed. And then I tried to use different PHP version, that I couldn't.
So if you could take a look, it would be nice.
My username is "ktulx" and the directory is "ktulx.rgb-pw.ru".

Thank you.
ktulx
New around here
 
Posts: 24
Joined: Sat Nov 12, 2011 7:37 pm

Re: Can't enable old PHP version support via .htaccess

Postby Max » Wed May 30, 2012 1:17 am

That problem is unrelated to the MySQL password issue whereby you have to recreate the user (and it's very good that you have done that).

The nature of the problem is right there in front of you - it's explained fairly well! The function mysql_escape_string is depreciated and shouldn't be used - use mysql_real_escape_string instead. If it's your own script, then you should change it - if it's someone else's, then either update it or tell them to fix it if no update fixes it.

I've added the correct code to the .htaccess of that directory:

AddType php53-script .php


So you won't get that error showing up anymore, but it will need to be fixed.
Max
Administrator
 
Posts: 1043
Joined: Sat Jul 18, 2009 3:17 pm

Re: Can't enable old PHP version support via .htaccess

Postby ktulx » Wed May 30, 2012 4:27 am

Hey, Max.

Thanks for your pretty informative response. I've thougt about the problem being related more with the script's code itself, but wasn't sure about it. So I will try to contact its developer anyway now.

With that update you did to the .htaccess I'm getting Internal Server Error :(
ktulx
New around here
 
Posts: 24
Joined: Sat Nov 12, 2011 7:37 pm

Re: Can't enable old PHP version support via .htaccess

Postby Max » Wed May 30, 2012 5:14 am

Can you link me to the web-page which is doing that please?

Always provide all the relevant information, otherwise I can't do much.
Max
Administrator
 
Posts: 1043
Joined: Sat Jul 18, 2009 3:17 pm

Re: Can't enable old PHP version support via .htaccess

Postby ktulx » Wed May 30, 2012 7:09 am

http://ktulx.rgb-pw.ru/

Don't know what information do you need. About the script - it is a new very small and simple blog-engine. Before the PHP update everything was working great.

Thank you.
ktulx
New around here
 
Posts: 24
Joined: Sat Nov 12, 2011 7:37 pm

Re: Can't enable old PHP version support via .htaccess

Postby Max » Wed May 30, 2012 9:58 am

The URL is all the info I need :)

I've made sure your site works now, the issue was that your public_html was 777 (world writable), which is not something you want - especially under suPHP.
Max
Administrator
 
Posts: 1043
Joined: Sat Jul 18, 2009 3:17 pm

Re: Can't enable old PHP version support via .htaccess

Postby ktulx » Wed May 30, 2012 6:54 pm

Strange thing. I think it wasn't 777 before.
Well, thanks a lot, seems to be fine now :)
ktulx
New around here
 
Posts: 24
Joined: Sat Nov 12, 2011 7:37 pm


Return to Support & Questions

Who is online

Users browsing this forum: No registered users and 3 guests

cron