Apache/PHP setup issues

I have a new server that I am setting up. I am using my test server (working one) as a road map to configure this live server.

For some reason my website will only run certain PHP files. Others it will just display the code instead of running. Other php files it will just display a blank page.

But certain ones do run ok. For instance, in a directory called install, the index.php there pulls up just fine.

Any ideas? Apache is setup with mostly defaults. PHP is installed and enabled.

I tried resinstalling apache/php5 many times…but still get the same results. I am obviously doing something wrong and can’t remember how to fix it.

:-\

Also, I noticed that my web application requires for exec() to be on. How can I verify whether or not this is enabled?

I think it would make sense since many of my php files are just failing to run.

Those misbehaving PHP files may be using short tags. Everybody should be using standard tags now: i.e. <?php ?>, not <? ?>

Also PHP filenames must be end in .php, or they won’t be recognised as PHP scripts.

You also should look in /var/log/apache2/error_log for any error messages.

exec() is only needed if the application needs to run a external program. Most don’t.

Since my error_log was so cluttered. I deleted it first and did “touch error_log” …that way i could start with a fresh one and notice quickly the errors.

Now I opened my website a few times…and when i got back to the log, its still blank.

The website still displays the PHP code rather than running it. And I can still open the PHP page inside the install folder just fine.

Just FYI:

  1. The way I setup Apache with yast2-http-server was through yast2.

  2. After i installed apache, I went back into yast2 and installed php5, php5_gd, php5_xsl, and php5_mbstring.

Then I went into my modules section in the HTTP yast2 app, and enabled php5 there. When I pull phpinfo(), it shows it enabled just fine.

RewriteEngine is also enabled.
and AllowOverride is set to All inside the yast2_vhosts.conf file.

You forgot to tell what the outcome is from looking into this. Or did you even forget to look?

Please show us yast2_vhosts.conf