This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
deb9:apache [2022/09/22 22:13] – [PHP Installation] Bernard Condrau | deb9:apache [2024/04/20 15:05] (current) – [PHP Extensions] Bernard Condrau | ||
---|---|---|---|
Line 1: | Line 1: | ||
- | ====== Apache 2.4 and PHP 7/8 ====== | + | ====== Apache 2.4 and PHP 5/7 ====== |
===== Apache 2.4 Installation ===== | ===== Apache 2.4 Installation ===== | ||
- | - Install apache 2.4< | + | - Install apache 2.4< |
- | sudo apt install apache2</ | + | $ sudo apt install apache2</ |
- | - Add one of the two commands to add the user to apache' | + | - Add one of the two commands to add the user to apache' |
- | sudo usermod -a -G www-data < | + | $ sudo usermod -a -G www-data < |
+ | - Setup your virtual hosts | ||
+ | - Create sub folders in ''/ | ||
+ | - Install and configure [[deb11: | ||
===== PHP Installation ===== | ===== PHP Installation ===== | ||
- Install packages< | - Install packages< | ||
- | $ sudo apt install -y curl wget gnupg2 ca-certificates lsb-release apt-transport-https</ | + | $ sudo apt install -y curl wget gnupg2 ca-certificates lsb-release apt-transport-https |
- | - Add the SURY repository to your system< | + | - Add the SURY repository to your system< |
- | sudo apt update</ | + | - Import the repository key< |
- | - Import the repository key< | + | - Install the desired PHP version, where V is the major and v is the minor version number, for example |
- | - Install the desired PHP version, where V is the major and v is the minor version number, for example | + | $ sudo apt install phpV.v</ |
- | sudo apt install phpV.v</ | + | |
- Enable modules:< | - Enable modules:< | ||
$ sudo a2enmod proxy | $ sudo a2enmod proxy | ||
$ sudo a2enmod proxy_http | $ sudo a2enmod proxy_http | ||
$ sudo a2enmod rewrite</ | $ sudo a2enmod rewrite</ | ||
- | * [[https:// | ||
* [[https:// | * [[https:// | ||
- | * [[https:// | ||
* [[https:// | * [[https:// | ||
* [[https:// | * [[https:// | ||
===== PHP Extensions ===== | ===== PHP Extensions ===== | ||
- | * PHP extensions for Joomla:< | + | * PHP extensions for Joomla:< |
- | * PHP extensions for Wiki:< | + | * PHP extensions for Wiki:< |
- | * Required for PHP7:< | + | * Restart the service with one of the 2 commands below:< |
- | * Restart the service with one of the 2 commands below:< | + | $ sudo / |
- | sudo service | + | |
===== Set or change PHP version ===== | ===== Set or change PHP version ===== | ||
Line 66: | Line 65: | ||
- Copy the output from / | - Copy the output from / | ||
- Go to the [[https:// | - Go to the [[https:// | ||
- | - Download that package, for example xdebug-3.1.5.tgz | + | - Download that package, for example xdebug-2.8.4.tgz |
- Install the pre-requisites for compiling PHP extensions< | - Install the pre-requisites for compiling PHP extensions< | ||
- | - Unpack the downloaded file with '' | + | - Unpack the downloaded file with '' |
phpize | phpize | ||
Configuring for: | Configuring for: | ||
... | ... | ||
- | Zend Module Api No: | + | Zend Module Api No: |
- | Zend Extension Api No: 320190902 | + | Zend Extension Api No: 3220170718 |
- If it does not, you are using the wrong phpize. Please follow [[https:// | - If it does not, you are using the wrong phpize. Please follow [[https:// | ||
- Run:< | - Run:< | ||
make</ | make</ | ||
- | - Copy the module to:< | + | - Copy the module to:< |
- | | + | - Modify the configuration in /etc/php/{7.2, 7.4}/ |
- | | + | |
xdebug.remote_enable=1 | xdebug.remote_enable=1 | ||
xdebug.remote_port=9000 (default: 9000) | xdebug.remote_port=9000 (default: 9000) | ||
Line 85: | Line 83: | ||
xdebug.profiler_enable_trigger=1 | xdebug.profiler_enable_trigger=1 | ||
xdebug.profiler_output_dir=PATH_TO_PROFILER_OUTPUT_DIR | xdebug.profiler_output_dir=PATH_TO_PROFILER_OUTPUT_DIR | ||
- | xdebug.remote_log=PATH_TO_LOG/ | + | xdebug.remote_log=PATH_TO_LOG/ |
- Change the PATH_TO_PROFILER_OUTPUT_DIR to point to the directory you want to receive profiler output. change PATH_TO_LOG to point to the directory where you want to receive xdebug.log. | - Change the PATH_TO_PROFILER_OUTPUT_DIR to point to the directory you want to receive profiler output. change PATH_TO_LOG to point to the directory where you want to receive xdebug.log. | ||
- Make sure that zend_extension = / | - Make sure that zend_extension = / | ||
- | - Xdebug 3: | ||
- | - Create ''/ | ||
- | xdebug.remote_port=9000 (default: 9003) | ||
- | xdebug.mode=debug</ | ||
- Restart your webserver. | - Restart your webserver. | ||
- Create a PHP page that has phpinfo(). Load it in a browser and look for the info on the Xdebug module. If you see it next to the Zend logo, you have been successful! | - Create a PHP page that has phpinfo(). Load it in a browser and look for the info on the Xdebug module. If you see it next to the Zend logo, you have been successful! | ||
Line 97: | Line 91: | ||
===== phpMyAdmin ===== | ===== phpMyAdmin ===== | ||
- | Debian 10, other than Debian 9, requires | + | Debian 10/11, other than Debian 9, require |
==== Installation ==== | ==== Installation ==== | ||
* Download [[https:// | * Download [[https:// | ||
Line 169: | Line 163: | ||
$ sudo service apache2 restart</ | $ sudo service apache2 restart</ | ||
- | ===== Let's Encrypt ===== | ||
- | * Secure all sites for your web server with SSL certificates:< | ||
- | * If you have existing SSL VirtualHost definitions you need to copy a certificate from another site or webserver to / | ||
- | * Run certbot and register sites:< | ||
- | * Check certificates:< | ||
- | * Add domains to certificate:< | ||
- | certbot certonly --webroot --agree-tos -w / | ||
- | * Revoke and optionally delete certificate:< | ||
- | * Delete certificate:< | ||
- | * Delete listed domains:< | ||
- | * All sites must be accessible through port 80 when renewing certificates. | ||
==== Links ==== | ==== Links ==== |