Title: php runs from the cmdline, apache does not execute
Last modified: August 19, 2016

---

# php runs from the cmdline, apache does not execute

 *  Resolved [larryzeropointcom](https://wordpress.org/support/users/larryzeropointcom/)
 * (@larryzeropointcom)
 * [15 years, 10 months ago](https://wordpress.org/support/topic/php-runs-from-the-cmdline-apache-does-not-execute/)
 * With a browser the php file returns as a download rather than executing the php
   file and returning the results of execution. I’m running on suse linux 11.2 64-
   bit, and apache2-2.2.13-2.4.1. I’m stumped as to how to debug this problem.
 * php is working and installed but there must be some sort of apache 2 issue. Search
   engine results have not been helpful.

Viewing 8 replies - 1 through 8 (of 8 total)

 *  Moderator [Ipstenu (Mika Epstein)](https://wordpress.org/support/users/ipstenu/)
 * (@ipstenu)
 * 🏳️‍🌈 Advisor and Activist
 * [15 years, 10 months ago](https://wordpress.org/support/topic/php-runs-from-the-cmdline-apache-does-not-execute/#post-1628885)
 * Does this happen on all php pages or just WordPress ones?
 * It may be wackiness with your version of PHP. What version are you running?
 *  Thread Starter [larryzeropointcom](https://wordpress.org/support/users/larryzeropointcom/)
 * (@larryzeropointcom)
 * [15 years, 10 months ago](https://wordpress.org/support/topic/php-runs-from-the-cmdline-apache-does-not-execute/#post-1628887)
 * all php pages..
 * php5-5.3.2-1.1.1
 *  Moderator [Ipstenu (Mika Epstein)](https://wordpress.org/support/users/ipstenu/)
 * (@ipstenu)
 * 🏳️‍🌈 Advisor and Activist
 * [15 years, 10 months ago](https://wordpress.org/support/topic/php-runs-from-the-cmdline-apache-does-not-execute/#post-1628889)
 * Yeah, sorry, it’s gotta be a server config issue 🙁 Do you have a webhost you
   can pester for help?
 *  Thread Starter [larryzeropointcom](https://wordpress.org/support/users/larryzeropointcom/)
 * (@larryzeropointcom)
 * [15 years, 10 months ago](https://wordpress.org/support/topic/php-runs-from-the-cmdline-apache-does-not-execute/#post-1628894)
 * I know that this is not a problem attributable to wordpress, but I’m not sure
   where to go or who to ask for help on this one. Any suggestions would be a great
   help.
 * I set up the standard info.php file
 * <?php
    phpinfo(); ?>
 * to test web access and apache returns the file as a download. I can run the file
   at the console and phpinfo() data returns. I uninstalled and then reinstalled
   apache and php just in case, but nothing has worked.
 *  Moderator [Ipstenu (Mika Epstein)](https://wordpress.org/support/users/ipstenu/)
 * (@ipstenu)
 * 🏳️‍🌈 Advisor and Activist
 * [15 years, 10 months ago](https://wordpress.org/support/topic/php-runs-from-the-cmdline-apache-does-not-execute/#post-1628911)
 * That’s why I asked if you have a web host or if you’re flying solo 🙂
 * Usually this is an apache handler issue. See [http://www.webmasterworld.com/apache/3418477.htm](http://www.webmasterworld.com/apache/3418477.htm)
   for a start.
 *  Thread Starter [larryzeropointcom](https://wordpress.org/support/users/larryzeropointcom/)
 * (@larryzeropointcom)
 * [15 years, 10 months ago](https://wordpress.org/support/topic/php-runs-from-the-cmdline-apache-does-not-execute/#post-1628945)
 * Thanks for the link, sounds exactly like what is happening here, but none of 
   the suggestions work for me.
 * AddHandler server-parsed .php
 * looks like exactly what I need but it didn’t work, and there wasn’t any other
   combinations of addtype or addhandler that made any difference. I also added 
   the mime type
 * application/x-httpd-php .php
 * to the mime.types file. Nothing seems to get apache to execute the php code.
 * I’m looking forward to getting WordPress installed, so I hope I can get this 
   sorted out..
 *  Thread Starter [larryzeropointcom](https://wordpress.org/support/users/larryzeropointcom/)
 * (@larryzeropointcom)
 * [15 years, 10 months ago](https://wordpress.org/support/topic/php-runs-from-the-cmdline-apache-does-not-execute/#post-1628962)
 * I have vmware running suse linux 11.2 and I quickly installed php, mysql and 
   apache, and php is processing the php files just fine.
 * My problem is on our deployment server and somehow I need to diagnose the problem
   and fix it. I know a lot of you have located this sort of problem. Can anyone
   give me some hints on where and what to look for? I will post the solution here
   of course as to what the problem is when I find it. It should save someone else
   a lot of time too.
 * Thanks!
 *  Thread Starter [larryzeropointcom](https://wordpress.org/support/users/larryzeropointcom/)
 * (@larryzeropointcom)
 * [15 years, 10 months ago](https://wordpress.org/support/topic/php-runs-from-the-cmdline-apache-does-not-execute/#post-1629065)
 * The solution!
 * Since I was able to see php executing on a fresh suse 11.2 install, I knew there
   was most likely an error in the configuration files. The server I am deploying
   on was to a great extent experimental and I must have created statements that
   interfered with php. I regret to say that I’m not sure what the final change 
   was that made it work. But it’s working great now.
 * I just basically trimmed the configuration in the server (/etc/apache2) to conform
   to the newer installation that worked, until it started working. Some apache 
   configuration rules are a little confusing, I most likely made a small mistake
   that rendered php5 inoperative.
 * I did find in the apache2 error logs a large number of errors that went away 
   when I used yast to shutdown apparmor. I had not fully configured apparmor, so
   there might have been an issue there.
 * I’m not aware of any side effects to shutting apparmor down, but things are working
   well now, so I can get on with the blog.
 * My thanks for the suggestions from ipstenu.. It got me off ‘stumped mode’ and
   gave me somewhere to start.
 * Now to the creative work!
 * Thanks.

Viewing 8 replies - 1 through 8 (of 8 total)

The topic ‘php runs from the cmdline, apache does not execute’ is closed to new 
replies.

 * In: [Installing WordPress](https://wordpress.org/support/forum/installation/)
 * 8 replies
 * 2 participants
 * Last reply from: [larryzeropointcom](https://wordpress.org/support/users/larryzeropointcom/)
 * Last activity: [15 years, 10 months ago](https://wordpress.org/support/topic/php-runs-from-the-cmdline-apache-does-not-execute/#post-1629065)
 * Status: resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
