Discussion:
htaccess
Tedd Sperling
2013-07-07 20:06:35 UTC
Permalink
Hi gang:

I have a client who has an account with GoDaddy (I know).

GoDaddy says they have PHP v 5.3 installed on the client's account, but phpinfo() says different, namely it reports 5.2.17.

After calling GoDaddy, they said the client has an htaccess file that makes everything 5.2 instead of 5.3.

Now, I'm not an expert on these things and the reason why I am asking here, but here are the two htaccess files I find at root level:

1. Named: .htaccess.bak_hosting_company_Apache24_compatibility_fix

Options +ExecCGI
AddType application/x-httpd-php .php .htm .html
AddHandler x-httpd-php5-cgi .php .htm .html
# AddHandler php5-script .php .html
# AddHandler x-httpd-php5 .php .html
ErrorDocument 404 /404.html
ErrorDocument 403 /403.html

AND

2. Named: .htacess

# The below FilesMatch stanza was added by your
# hosting provider on 2013-06-27 11:05:33
# to resolve a potential Apache 2.4
# compatibility issue with your custom AddHandler(s)
# for PHP. If you feel this was in error, please
# contact support and we will work to resolve the
# issue. Thanks!
<FilesMatch "\.(htm|html)$">
Options +ExecCGI
</FilesMatch>

Options +ExecCGI
AddType application/x-httpd-php .php .htm .html
AddHandler x-httpd-php5-cgi .php .htm .html


Does anyone see a problem here?

OR -- a way to get PHP to version 5.3?

Cheers,

tedd

_____________________
***@sperling.com
http://sperling.com
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
Simon J Welsh
2013-07-07 20:10:01 UTC
Permalink
Post by Tedd Sperling
I have a client who has an account with GoDaddy (I know).
GoDaddy says they have PHP v 5.3 installed on the client's account, but phpinfo() says different, namely it reports 5.2.17.
After calling GoDaddy, they said the client has an htaccess file that makes everything 5.2 instead of 5.3.
1. Named: .htaccess.bak_hosting_company_Apache24_compatibility_fix
Options +ExecCGI
AddType application/x-httpd-php .php .htm .html
AddHandler x-httpd-php5-cgi .php .htm .html
# AddHandler php5-script .php .html
# AddHandler x-httpd-php5 .php .html
ErrorDocument 404 /404.html
ErrorDocument 403 /403.html
AND
2. Named: .htacess
# The below FilesMatch stanza was added by your
# hosting provider on 2013-06-27 11:05:33
# to resolve a potential Apache 2.4
# compatibility issue with your custom AddHandler(s)
# for PHP. If you feel this was in error, please
# contact support and we will work to resolve the
# issue. Thanks!
<FilesMatch "\.(htm|html)$">
Options +ExecCGI
</FilesMatch>
Options +ExecCGI
AddType application/x-httpd-php .php .htm .html
AddHandler x-httpd-php5-cgi .php .htm .html
Does anyone see a problem here?
OR -- a way to get PHP to version 5.3?
Cheers,
tedd
I don’t use GoDaddy, so this may not be entirely accurate.

I’m guessing that it’s these two lines in .htaccess:
AddType application/x-httpd-php .php .htm .html
AddHandler x-httpd-php5-cgi .php .htm .html
They’re changing the handler from PHP files from the default ones to x-httpd-php5-cgi, which would cause PHP 5.2 to be used instead. Try commenting out these two lines.

---
Simon Welsh
Admin of http://simon.geek.nz/
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
Tedd Sperling
2013-07-07 20:22:56 UTC
Permalink
Simon:

Confirmed. Those two lines cause the problem.

However, commenting out those lines causes other problems.

Are there similar statements to these:

AddType application/x-httpd-php .php .htm .html
AddHandler x-httpd-php5-cgi .php .htm .html

That will allow for their function (whatever that may be), but not reduce PHP to version 5.2.17?

If these statement are for only the php interpreter to consider html prefixes, then I use the following on my main site:

# handler for phpsuexec. -- this makes these prefixes considered for php
<FilesMatch "\.(htm|html|css)$">
SetHandler application/x-httpd-php
</FilesMatch>

And it works for me without the PHP version reduction.

What do you say?

And thanks...

Cheers,

tedd
Post by Simon J Welsh
Post by Tedd Sperling
I have a client who has an account with GoDaddy (I know).
GoDaddy says they have PHP v 5.3 installed on the client's account, but phpinfo() says different, namely it reports 5.2.17.
After calling GoDaddy, they said the client has an htaccess file that makes everything 5.2 instead of 5.3.
1. Named: .htaccess.bak_hosting_company_Apache24_compatibility_fix
Options +ExecCGI
AddType application/x-httpd-php .php .htm .html
AddHandler x-httpd-php5-cgi .php .htm .html
# AddHandler php5-script .php .html
# AddHandler x-httpd-php5 .php .html
ErrorDocument 404 /404.html
ErrorDocument 403 /403.html
AND
2. Named: .htacess
# The below FilesMatch stanza was added by your
# hosting provider on 2013-06-27 11:05:33
# to resolve a potential Apache 2.4
# compatibility issue with your custom AddHandler(s)
# for PHP. If you feel this was in error, please
# contact support and we will work to resolve the
# issue. Thanks!
<FilesMatch "\.(htm|html)$">
Options +ExecCGI
</FilesMatch>
Options +ExecCGI
AddType application/x-httpd-php .php .htm .html
AddHandler x-httpd-php5-cgi .php .htm .html
Does anyone see a problem here?
OR -- a way to get PHP to version 5.3?
Cheers,
tedd
I don’t use GoDaddy, so this may not be entirely accurate.
AddType application/x-httpd-php .php .htm .html
AddHandler x-httpd-php5-cgi .php .htm .html
They’re changing the handler from PHP files from the default ones to x-httpd-php5-cgi, which would cause PHP 5.2 to be used instead. Try commenting out these two lines.
---
Simon Welsh
Admin of http://simon.geek.nz/
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
Tim Streater
2013-07-08 08:54:00 UTC
Permalink
Post by Tedd Sperling
Confirmed. Those two lines cause the problem.
However, commenting out those lines causes other problems.
AddType application/x-httpd-php .php .htm .html
This one tells apache to recognise .php, .htm, and .html as suffixes of files that need to be sent to PHP. You probably don't want to remove that [1].
Post by Tedd Sperling
AddHandler x-httpd-php5-cgi .php .htm .html
Dunno what this one does.

[1] But, having said that, realise that *all* files with those suffixes will be sent to PHP by apache, whether they contain any PHP code or not. Is that what you want? If I have an html file that contains some PHP code, I tend to use .phtml as suffix and so my AddType looks like:

AddType application/x-httpd-php .php .phtml
--
Cheers -- Tim
Loading...