Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
deb12:lamp [2024/04/06 23:10] – [PHP Extensions] Bernard Condraudeb12:lamp [2024/04/25 15:31] (current) – [Links] Bernard Condrau
Line 62: Line 62:
   - Copy the output from /var/www/html/php_info.txt   - Copy the output from /var/www/html/php_info.txt
   - Go to the [[https://xdebug.org/wizard|Xdebug: Installation Wizard]], and paste the output inside the text box on the page. It will analyze the output and will recommend the most suited package of Xdebug.   - Go to the [[https://xdebug.org/wizard|Xdebug: Installation Wizard]], and paste the output inside the text box on the page. It will analyze the output and will recommend the most suited package of Xdebug.
-  - Download that package, for example xdebug-2.8.4.tgz+  - Download that package from the output before by clicking on it's name, for example xdebug-3.3.2.tgz
   - Install the pre-requisites for compiling PHP extensions<code>sudo apt install phpV.v-dev autoconf automake</code>   - Install the pre-requisites for compiling PHP extensions<code>sudo apt install phpV.v-dev autoconf automake</code>
-  - Unpack the downloaded file with ''tar -xvzf xdebug-2.8.4.tgz'' within a temp folder, then change to that folder, run //phpize// and check it's output:<code>cd xdebug-2.8.4+  - Unpack the downloaded file with ''tar -xvzf xdebug-3.3.2.tgz'' within a temp folder, then change to that folder, run ''phpize'' and check it's output:<code>cd xdebug-3.3.2
 phpize phpize
 Configuring for: Configuring for:
-... +PHP Api Version:         20230831 (8.3) 
-Zend Module Api No:      20170718 (7.2), 20190902 (7.4) +Zend Module Api No:      20230831 
-Zend Extension Api No:   3220170718 (7.2), 320190902 (7.4)</code>+Zend Extension Api No:   420230831</code>
   - If it does not, you are using the wrong phpize. Please follow [[https://xdebug.org/docs/faq#custom-phpize|this FAQ entry]] and skip the next step.   - If it does not, you are using the wrong phpize. Please follow [[https://xdebug.org/docs/faq#custom-phpize|this FAQ entry]] and skip the next step.
   - Run:<code>./configure   - Run:<code>./configure
 make</code> make</code>
-  - Copy the module to:<code>sudo cp modules/xdebug.so /usr/lib/php/{20170718, 20190902}</code> +  - Copy the module to:<code>sudo cp modules/xdebug.so /usr/lib/php/20230831</code> 
-  - Modify the configuration in /etc/php/{7.2, 7.4}/cli/php.ini for Xdebug 2:<file>zend_extension = /usr/lib/php/{20170718, 20190902}/xdebug.so+  - Modify the configuration in /etc/php/{7.2, 7.4}/cli/php.ini for Xdebug 2:<file>zend_extension = /usr/lib/php/20230831/xdebug.so
 xdebug.remote_enable=1 xdebug.remote_enable=1
 xdebug.remote_port=9000 (default: 9000) xdebug.remote_port=9000 (default: 9000)
Line 82: Line 82:
 xdebug.remote_log=PATH_TO_LOG/xdebug.log</file> xdebug.remote_log=PATH_TO_LOG/xdebug.log</file>
     - 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 = /usr/lib/php/20190902/xdebug.so is below the line for OPcache. Please also update php.ini files in adjacent directories (//apache2// and //cli//), as your system might be configured with a separate php.ini file for the web server and command line.+    - Make sure that zend_extension = /usr/lib/php/20230831/xdebug.so is below the line for OPcache. Please also update php.ini files in adjacent directories (//apache2// and //cli//), as your system might be configured with a separate php.ini file for the web server and command line.
   - 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!
   - On the command line, you can also ''php -m''. This lists all loaded modules. Xdebug should appear twice there (once under 'PHP Modules' and once under 'Zend Modules').   - On the command line, you can also ''php -m''. This lists all loaded modules. Xdebug should appear twice there (once under 'PHP Modules' and once under 'Zend Modules').
 +
 +===== MariaDB 10.11.6 Installation =====
 +  - Install<file>$ sudo apt install mariadb-server</file>
 +  - Start MariaDB<file>$ sudo service mariadb start</file>
 +  - Secure the installation following [[https://linuxgenie.net/how-to-install-mariadb-on-debian-12-bookworm-distribution/|How to Install MariaDB on Debian 12 Bookworm Distribution]]<file>$ sudo mariadb-secure-installation</file>
 +  - Assign a password to root
 +  - Dump all databases on the old server<file>$ sudo mysqldump --all-databases > sql_file.sql</file>
 +  - Copy ''sql_file.sql'' to the new server and remove databases ''mysql'' and ''phpmyadmin'' from the dump file, then import with<file>$ sudo mysql < sql_file.sql</file>
  
 ===== phpMyAdmin ===== ===== phpMyAdmin =====
-Debian 10/11, other than Debian 9, require manual installation of phpmyadmin, phpmyadmin has been removed from Debian's repositories. +  * [[deb11:phpmyadmin|phpMyAdmin]] 
-==== Installation ==== +
-  Download [[https://www.phpmyadmin.net/downloads/|phpMyAdmin]] from the Downloads page, scroll down to the table with download links for the latest stable release, and copy the download link ending in tar.gz:<code>wget https://files.phpmyadmin.net/phpMyAdmin/5.0.2/phpMyAdmin-5.0.2-english.tar.gz</code> +
-  * Unzip the tarball, then move the folder:<code>tar xvf phpMyAdmin-5.0.2-english.tar.gz +
-sudo mv phpMyAdmin-5.0.2-english/ /usr/share/phpmyadmin</code>+
  
-==== Configuration ==== 
-  * To begin, make a new directory where phpMyAdmin will store its temporary files and set ownership:<code>sudo mkdir -p /var/lib/phpmyadmin/tmp 
-sudo chown -R www-data:www-data /var/lib/phpmyadmin</code> 
-  * In the same folder, create a file with the blowfish secret passphrase and set permissions:<code>sudo vim /var/lib/phpmyadmin/blowfish_secret.inc.php 
-<?php 
-$cfg['blowfish_secret'] = '32-CHAR-LONG-SECRET-KEY'; 
-<ESC>:wq 
-sudo chown root:www-data /var/lib/phpmyadmin/blowfish_secret.inc.php 
-sudo chmod 640 /var/lib/phpmyadmin/blowfish_secret.inc.php</code> 
-  * Copy folder {{:deb9:phpmyadmin.zip|phpmyadmin}} from a Debian 9 installation to /etc. Check the **apache.conf** file and remove path elements in //php_admin_value open_basedir// which do not exist in your system. 
-  * Symlink the configuration files for apache:<code>cd /etc/apache2/conf-available 
-ln -s ../../phpmyadmin/apache.conf phpmyadmin.conf 
-cd ../conf-enabled 
-ln -s ../conf-available/phpmyadmin.conf phpmyadmin.conf</code> 
-  * Symlink the configuration files for phpmyadmin in it's root folder:<code>cd /usr/share/phpmyadmin 
-ln -s /etc/phpmyadmin/config.inc.php config.inc.php 
-ln -s /etc/phpmyadmin/config.header.inc.php config.header.inc.php 
-ln -s /etc/phpmyadmin/config.footer.inc.php config.footer.inc.php</code> 
-  * Create a additional config file with the path to the **tmp** directory:<code>vim /etc/phpmyadmin/conf.d/tempdir.php 
-<?php 
-$cfg['TempDir'] = '/var/lib/phpmyadmin/tmp';</code> 
-  * Make sure the //phpmyadmin// user has been created in mysql:<code>mysql -u <my-admin-user> -p 
-SELECT user,host FROM mysql.user; 
-CREATE USER 'user'@'localhost' IDENTIFIED BY 'password'; 
-GRANT USAGE ON phpmyadmin.* TO phpmyadmin</code> 
-  * The password is in file /etc/phpmyadmin/config-db.php. Restrict permissions of that file as it contains a password:<code>sudo chown root:www-data /etc/phpmyadmin/config-db.php 
-sudo chmod 640 /etc/phpmyadmin/config-db.php</code> 
-  * Create a regular MariaDB user for the purpose of managing databases through phpMyAdmin, as it’s recommended that you log in using another account than the pma user. You could create a user that has privileges to all tables within the database, as well as the power to add, change, and remove user privileges, with this command. Whatever privileges you assign to this user, be sure to give it a strong password as well:<code>sudo mariadb 
-GRANT ALL PRIVILEGES ON *.* TO 'user'@'localhost' IDENTIFIED BY 'password' WITH GRANT OPTION; 
-exit</code> 
-  * [[https://docs.phpmyadmin.net/en/latest/config.html|phpMyAdmin Configuration]] 
  
-==== Manual Upgrade on Debian 9 ==== 
-  * Check latest version of [[https://www.phpmyadmin.net/|phpMyAdmin]] 
-  * Download and install<code>cd /usr/share/phpmyadmin/ 
-sudo wget https://files.phpmyadmin.net/phpMyAdmin/5.1.0/phpMyAdmin-5.1.0-english.tar.gz 
-tar xzf phpMyAdmin-5.1.0-english.tar.gz 
-sudo mv phpMyAdmin-5.1.0-english phpmyadmin</code> 
-  * Modify the following lines in /usr/share/phpmyadmin/libraries/vendor_config.php<code>define('TEMP_DIR', '/var/lib/phpmyadmin/tmp/'); 
-define('CONFIG_DIR', '/etc/phpmyadmin/');</code> 
-  * See [[https://kenfavors.com/code/how-to-manually-upgrade-phpmyadmin/|How To Manually Upgrade phpMyAdmin]] and [[https://phpsolved.com/phpmyadmin-blowfish-secret-generator/|phpMyAdmin blowfish secret generator]] 
-==== Security ==== 
-  * You should secure access to phpmyadmin, for example by limiting access to verified ip addresses 
 ===== Windows Subsystem for Linux ===== ===== Windows Subsystem for Linux =====
   * For Windows Subsystem for Linux, create a **Virtual Host** file with document root in ///mnt/<drive>/htdocs// or similar, if you need to access it through the Windows file system.   * For Windows Subsystem for Linux, create a **Virtual Host** file with document root in ///mnt/<drive>/htdocs// or similar, if you need to access it through the Windows file system.
Line 167: Line 130:
   * [[https://webmasters.stackexchange.com/questions/126557/what-is-the-difference-of-certbot-and-certbot-auto|What is the difference of certbot and certbot-auto?]]   * [[https://webmasters.stackexchange.com/questions/126557/what-is-the-difference-of-certbot-and-certbot-auto|What is the difference of certbot and certbot-auto?]]
   * [[https://www.jesusamieiro.com/remove-revoke-a-domain-in-lets-encrypt/|Remove a domain in Let’s Encrypt]]   * [[https://www.jesusamieiro.com/remove-revoke-a-domain-in-lets-encrypt/|Remove a domain in Let’s Encrypt]]
 +  * [[https://linuxgenie.net/how-to-install-mariadb-on-debian-12-bookworm-distribution/|How to Install MariaDB on Debian 12 Bookworm Distribution]]
 ===== SSL for localhost ===== ===== SSL for localhost =====
 ==== Ignore invalid certificates ==== ==== Ignore invalid certificates ====