0

I have suse tumbleweed, apache and php7. The setup i did as described in https://en.opensuse.org/SDB:LAMP_setup. I installed apache and tested with file index.html successfully with browser chrome. Then I defined index.php as described in that site but chrome just downloads php file, but does not display.

Instead browser just downloads the php-file. Any suggestions?

user2609605
  • 419
  • 2
  • 14

2 Answers2

1

Please check this Stackoverflow answer

Additionally, you can also use the command: apache2ctl -M to check if PHP module is loaded in Apache. In case the apache2ctl command doesn't work, try the command: httpd -M

  • Thank you, apache2ctl -M shows that the module is not loaded... What is strange: a2enmod php7.4 indicates that this is loaded. Also with php7 – user2609605 Sep 08 '20 at 08:44
  • The link you sent helped: what was missing is the entry `AddType application/x-httpd-php .php` and I wonder why this is not mentioned in the description https://en.opensuse.org/SDB:LAMP_setup. Strange enough, now apache2ctl -M shows `php7_module` to be loaded.. Why that? – user2609605 Sep 08 '20 at 09:05
  • Thank you... now also my phpmyadmin shows up correctly... – user2609605 Sep 08 '20 at 09:07
  • AddType principally adds a content type header to the HTML page that is output. AddHandler principally tells Apache to invoke a PHP handler for .php files. There are several ways of doing that, hence several variations in the syntax [-Source for above.](https://www.webmasterworld.com/apache/4557229.htm) You could also refere to Apache Directive [Documentation](https://httpd.apache.org/docs/2.4/mod/mod_mime.html#addtype) – JackSparrow Sep 08 '20 at 09:33
0

What is the content of your php file. If you have some syntax error, the page will just die without showing any info. First, verify all lines for errors and especially ";" at the end of each line. Then, if it doesn't help, try to debug by commenting some lines and using die().

If it's not the problem of the file, then you should verify your php server settings. send the log and your settings file