Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

AddType / AddHandler Not Working

I'm working on a mac running OS X Lion and PHP 5.3.6 and have tried both AddType, AddHander, and AllowOverride has been set to ALL in the httpd.conf; however, the PHP codes in HTML/JS/CSS files are still parsed as text. Files ending with .php are all good. I'm now getting really desperate after hours of googling.

Here are the contents of my .htaccess file:

AddType application/x-httpd-php5 .html .js .css 
AddType application/x-httpd-php .html .js .css 

AddHandler application/x-httpd-php5 .html .js .css 
AddHandler application/x-httpd-php.html .js .css 
like image 710
user1136314 Avatar asked May 15 '26 04:05

user1136314


1 Answers

If your site is stored in your user's Sites folder (i.e. /Users/username/Sites/) then you also need to set AllowOveride in the user-specific configuration file in /etc/apache2/users/username.conf. After making the change restart apache by disabling and re-enabling Web Sharing in the Sharing preference pane.

like image 74
Dave Avatar answered May 18 '26 15:05

Dave



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!