Unterschiede
Hier werden die Unterschiede zwischen zwei Versionen angezeigt.
Beide Seiten der vorigen Revision Vorhergehende Überarbeitung Nächste Überarbeitung | Vorhergehende Überarbeitung | ||
content:apache_phpfpm [2022/11/22 22:01] – [Manage Database with phpMyAdmin] Daniel | content:apache_phpfpm [2025/02/19 14:30] (aktuell) – [LAMPf: Linux / Apache / MariaDB / PHP- FPM- Serverguide] Daniel | ||
---|---|---|---|
Zeile 1: | Zeile 1: | ||
- | ====== Apache PHP- FPM- Serverguide ====== | + | ====== |
+ | |||
+ | Note: The here explained way of setting up a webserver is very performant plus very slim and basic and may be a very good way if your machine is old and/or your ressources are low and you want to deliver solid, fast and small services based on native distribution- liked builds. But it needs some manual maintanance and a well working, full featured Linux- Distribution, | ||
+ | |||
+ | For example: if you want to make those Services available on the internet, you should definitively want to make webservices SSL- secured. Getting automatic SSL- Certificates and renew them in a good way, will work if you know how to set it up, but the setup is just another thing to care about. | ||
+ | |||
+ | So nowadays there are solutions to make complexity for that more handy which would be e.g. using Docker or Podman - which would be another, very different approach for large system, delivering a full, extremly powerful service- infrastructure in a pre- build way (it also delivers apache with php-fpm and automatic ssl-acme-challanges out of the box in many packages!). | ||
+ | |||
+ | So if you plan to set up a new fully flagged Server which will have many needed services, don't use this setup. Just after installation go straight into installing and setting up e.g. Docker and go on and use it for all services you can find there. | ||
+ | |||
+ | You can find the new way how to setup a server here: [[.: | ||
+ | |||
+ | So this for me is deprecated as i bought a new server here. I won't spend any time here. If you wann know more about nowadays setups, feel free and write a mail to me, maybe i will deliver docs to this than. HF and GL obel1x | ||
===== Howto setup a LAMP-Server in 2018 - 2020+ ===== | ===== Howto setup a LAMP-Server in 2018 - 2020+ ===== | ||
Zeile 59: | Zeile 72: | ||
In OpenSuSE MariaDB is available and working out of the Box. Check with: | In OpenSuSE MariaDB is available and working out of the Box. Check with: | ||
- | |||
< | < | ||
+ | |||
sudo zypper install mariadb | sudo zypper install mariadb | ||
Zeile 96: | Zeile 109: | ||
To setup passwords, run / | To setup passwords, run / | ||
- | |||
==== Install Apache ==== | ==== Install Apache ==== | ||
Zeile 150: | Zeile 162: | ||
</ | </ | ||
+ | |||
If thats fine, please stop apache once again to configure php-fpm first. | If thats fine, please stop apache once again to configure php-fpm first. | ||
Zeile 230: | Zeile 243: | ||
==== About PHP- Modules ==== | ==== About PHP- Modules ==== | ||
- | many modules for PHP are offered in the Distrubution. I **would not recommend using those** | + | many modules for PHP are offered in the Distrubution. I **would not recommend using those** |
Better use pearl / pecl and install modules with it! Here, i have found no other way, than to search for php-pear and php-pecl in the distribution and use them. | Better use pearl / pecl and install modules with it! Here, i have found no other way, than to search for php-pear and php-pecl in the distribution and use them. | ||
Zeile 238: | Zeile 251: | ||
Which can be found in the Repo: [[https:// | Which can be found in the Repo: [[https:// | ||
- | After that, modules can be installed by e.g. "pecl install imagick" | + | After that, modules can be installed by e.g. "pecl install imagick" |
+ | |||
+ | To make pecl/paer alter the ini automagically, | ||
+ | < | ||
+ | |||
+ | pear config-set php_ini / | ||
+ | pecl config-set php_ini / | ||
+ | |||
+ | </ | ||
Restart php-fpm for the changes and check the log of php-fpm (usually in / | Restart php-fpm for the changes and check the log of php-fpm (usually in / | ||
Zeile 249: | Zeile 270: | ||
* To enable this and all its dependencies, | * To enable this and all its dependencies, | ||
- | < | ||
+ | < | ||
sudo a2enmod setenvif | sudo a2enmod setenvif | ||
sudo a2enmod rewrite | sudo a2enmod rewrite | ||
Zeile 324: | Zeile 345: | ||
This should give you the complete Info of your php-configuration. If something fails, check if the above services are started an/or the logfiles. | This should give you the complete Info of your php-configuration. If something fails, check if the above services are started an/or the logfiles. | ||
- | If you get Permission denied even if your file is world- readable and the user wwwrun can access the content, in Leap 15.4 there are strict permissions in AppArmor. So check Yast / AppArmor and Check the Protocols. You will most likely find entries that needs to be changed. After that, Access should work. | + | If you get Permission denied even if your file is world- readable and the user wwwrun can access the content, in Leap 15.4 there are strict permissions in AppArmor. So check Yast / AppArmor and Check the Protocols. You will most likely find entries that needs to be changed |
In Production, you should not run a plain http-server, | In Production, you should not run a plain http-server, | ||
Well: You are done. Now its up to you to fill Apache with content. Have fun! | Well: You are done. Now its up to you to fill Apache with content. Have fun! | ||
- | |||
==== Manage Database with phpMyAdmin ==== | ==== Manage Database with phpMyAdmin ==== | ||
Zeile 338: | Zeile 358: | ||
Hint: phpMyAdmin in Opensuse seems to be reduced in functionality. For example generating config.inc.php with [[http:// | Hint: phpMyAdmin in Opensuse seems to be reduced in functionality. For example generating config.inc.php with [[http:// | ||
- | |||
==== About security of your WEB- Page (Scripts) ==== | ==== About security of your WEB- Page (Scripts) ==== | ||
Zeile 391: | Zeile 410: | ||
As Database you can create a new user (e.g. named ep3) with corresponid database and fill the configuration to fit. | As Database you can create a new user (e.g. named ep3) with corresponid database and fill the configuration to fit. | ||
- | After that, your testinstallation | + | ==== Using Eclipse to work on that Project ==== |
+ | |||
+ | In Eclipse now add a project and use GIT smart import from that directory location - it should configure git and eclipse + php the right way and you should be ready to go programming! | ||
+ | |||
+ | ==== Setup Debugging of PHP ==== | ||
+ | |||
+ | To setup Debugging of code, install xdebug for php via pecl: | ||
+ | < | ||
+ | |||
+ | pecl install xdebug | ||
+ | |||
+ | </ | ||
+ | |||
+ | Now, also add | ||
+ | |||
+ | < | ||
+ | xdebug.mode=debug | ||
+ | |||
+ | </ | ||
+ | |||
+ | Now restart php-fpm and check the php_info() if xdebug is enabled and if Step debugging is active. Otherwise check logs. | ||
+ | |||
+ | Adjusting timeouts in apache fcgi: Add Timeouts to / | ||
+ | |||
+ | < | ||
+ | ... | ||
+ | | ||
+ | | ||
+ | ... | ||
+ | |||
+ | </ | ||
+ | |||
+ | And of course restart apache2. | ||
+ | |||
+ | ==== Setup of Eclipse ==== | ||
+ | |||
+ | You need to add the PHP- Environement and the Debugger in Eclipse. | ||
+ | |||
+ | {{.: | ||
+ | |||
+ | and | ||
+ | |||
+ | {{.: | ||
+ | |||
+ | Mind to use the Port phpinfo tells you. Thats it start debugging with e.g. index.php of the project: | ||
+ | |||
+ | {{.: | ||
+ | |||
+ | That should | ||
+ | |||
+ | You can walk through the code with F5 (dive into), F6 (step over) or just let the work go on with F8. | ||
+ | |||
+ | You are done setting up webserver, php-fpm, mariadb and eclipse plus your new git- repository. hafe fun! | ||