Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

FutureWeb's avatar

application/x-httpd-php app.php PHP script text in body after php 5.5.19 update

Hi Larafolks,

I have recently updated my servers php to 5.5.19 and in my laravel project I am getting

application/x-httpd-php app.php PHP script text 

on every page of the app but I cannot figure out where it is coming from or why all my other php sites are unaffected :( any help would be great.

Thanks in advance

0 likes
1 reply
isimmons's avatar

There is a problem with the mime type for php files. If all you did was upgrade php then I'm wondering if a file or directory name got changed somewhere in the upgrade?

In my Apache/Windows setup in http.conf I have the following under the IfModule mime_module section

AddType application/x-httpd-php .php
Action application/x-httpd-php "/php/php-cgi.exe"

If I comment it out and restart Apache I get the actual php code showing which makes sense because the server doesn't know how to serve php files.

I tried making the path to my php-cgi.exe incorrect thinking it might cause the same issue but it actually gave me a internal server error instead of showing the php code so not very helpful.

But I would guess whether Apache or Nginx, Windows, Linux, or Mac, there should be a similar setting in the servers config files and either a incorrect version of PHP for your system or a change in the path could cause this.

Please or to participate in this conversation.