I am trying to set up php on a Tumbleweed system and I am having issues getting the thing to work. I looked through the wiki, stack exchange etc and I can’t seem to get any proposed solution to work so I am obviously missing something.
S | Name | Summary | Type
i+ | php8 | Interpreter for the PHP scripting language version 8 | package
i+ | php8-bz2 | PHP bzip2 codec support | package
i+ | php8-cli | Interpreter for the PHP scripting language version 8 | package
i | php8-ctype | Character class extension for PHP | package
i+ | php8-curl | PHP libcurl integration | package
i | php8-dom | Document Object Model extension for PHP | package
i+ | php8-fpm | FastCGI Process Manager PHP Module | package
i+ | php8-fpm-apache | Apache configuration for PHP-FPM | package
i+ | php8-gd | GD Graphics Library extension for PHP | package
i | php8-iconv | Character set conversion functions for PHP | package
i+ | php8-imagick | Wrapper to the ImageMagick library | package
i+ | php8-ldap | LDAP protocol support for PHP | package
i+ | php8-mbstring | Multibyte string functions for PHP | package
i+ | php8-mysql | MySQL database client for PHP | package
i+ | php8-odbc | ODBC extension for PHP | package
i | php8-openssl | OpenSSL integration for PHP | package
i | php8-pdo | PHP Data Objects extension for PHP | package
i+ | php8-pgsql | PostgreSQL database client for PHP | package
i+ | php8-readline | PHP readline extension | package
i+ | php8-smbclient | A PHP wrapper for libsmbclient | package
i+ | php8-snmp | SNMP extension for PHP | package
i | php8-sqlite | SQLite database client for PHP | package
i+ | php8-ssh2 | PHP bindings for the libssh2 library | package
i | php8-tokenizer | Extension module to access Zend Engine's PHP tokenizer | package
i | php8-xmlreader | Streaming XML reader extension for PHP | package
i | php8-xmlwriter | Streaming-based XML writer extension for PHP | package
i+ | php8-zip | ZIP archive support for PHP | package
I also added this: /etc/apache2/mod_mime-defaults.conf added a line at the end:
AddType application/x-httpd-php .php
I do not know what other permissions I need to change to allow apache to utilize php. I have set this up in the past using the instruction on the LAMP setup with out issue. Now, it is no longer correct. I would like to know what I did wrong so that I may correct the Wiki.
I think that is normal. When you stop using PHP in your server, the URL is treated as a request to download file.php and no longer a request to execute file.php as a PHP script. Thus the server duly downloads it to the client, although I do not know what the MIME definition (The type= parameter in the HTTP header) will contain.
The client then gets a file with no, or an insufficient, MIME definition and thus has no idea how to render it. Thus it asks you in distress if it should download it and store in a file.
BTW, your test proves that in your Tumbleweed case PHP8 is used in the LAMP server and that you found the correct place where it is defined to be loaded and used.
And thus your question to the OP is correct (and my first answer to it about the path of the file was utterly wrong).
But apart from the fact that the OP should check your suggestion, I still think it is something different. The more beacuse his error is not the same as what you experience.
Probably something to do with the user running the server (wwwrun ?) and the owner of the files involved.
Running aa-teardown solved the issue. I do, however, think that it would be a bad idea to run this system with all AppArmor profiles unloaded.
I did a cursory search for php AppArmor profile and didn’t see anything that stuck out as THE WAY I should add a profile to use PHP. I’m sure that there is a proper [open]SUSE way of doing this to keep this in a best practice condition.