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 it.

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

2 Answers 2

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

Sign up to request clarification or add additional context in comments.

4 Comments

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
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 en.opensuse.org/SDB:LAMP_setup. Strange enough, now apache2ctl -M shows php7_module to be loaded.. Why that?
Thank you... now also my phpmyadmin shows up correctly...
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. You could also refere to Apache Directive Documentation
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

1 Comment

The second was the problem: file was ok, but server settings were not.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.