Hello, In my Droplet i have php 7.4. I installed 7.3 with https://www.digitalocean.com/community/tutorials/how-to-run-multiple-php-versions-on-one-server-using-apache-and-php-fpm-on-ubuntu-18-04-fr
When I use a 7.4 Prestashop find a database, but when i change it to php 7.3 I have this erreur : Database Server is not found. Please verify the login, password and server fields (DbPDO)
You help please. Thx
This textbox defaults to using Markdown to format your answer.
You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!
Hi @khalid94.
Are you sure you have the php-mysql extension? Make sure you type in the following inside of your droplet
sudo apt-get install php7.3-mysql
If it’s not installed, select Y and install it.
That should help with your issues.
Hi @KFSys Thank you for answer. My sql it’s OK .
code
sudo apt-get install php7.3-mysql Reading package lists… Done Building dependency tree Reading state information… Done php7.3-mysql is already the newest version (7.3.27-9+ubuntu20.04.1+deb.sury.org+1). 0 upgraded, 0 newly installed, 0 to remove and 35 not upgraded.
code
But he don’t work. but if I change php site to 7.4 it work’s.
you can see my phpinfo in http://hb-plomberie-chauffage.fr/phpinfo.php
Thank you
The issue you’re encountering with PrestaShop and PHP 7.3 is likely due to a missing or misconfigured PHP extension that PrestaShop requires to connect to the database. Here’s how to troubleshoot and resolve the issue:
Ensure that PHP 7.3 is installed correctly and includes all the necessary extensions for PrestaShop.
php7.3 -m
Look for the following modules:
pdopdo_mysqlmysqliIf any are missing, install them:
sudo apt install php7.3-mysql
sudo systemctl restart php7.3-fpm
When switching between PHP versions, ensure Apache is using the correct PHP version.
sudo a2dismod php7.4
sudo a2enmod php7.3
sudo systemctl restart apache2
php -v
Make sure PrestaShop is using the correct database connection details.
app/config/parameters.php file in your PrestaShop installation directory:nano /path/to/prestashop/app/config/parameters.php
If the error persists:
<?php
$pdo = new PDO('mysql:host=127.0.0.1;dbname=your_database_name', 'your_username', 'your_password');
echo "Database connection successful!";
?>
test_db.php in your web root and access it in your browser. If it fails, it indicates an issue with your PHP 7.3 MySQL extension.Review the MySQL logs for any clues:
sudo tail -f /var/log/mysql/error.log
If you’re using PHP-FPM with Apache, ensure the configuration for PHP 7.3 is correct.
sudo nano /etc/php/7.3/fpm/pool.d/www.conf
Get paid to write technical tutorials and select a tech-focused charity to receive a matching donation.
Full documentation for every DigitalOcean product.
The Wave has everything you need to know about building a business, from raising funding to marketing your product.
Stay up to date by signing up for DigitalOcean’s Infrastructure as a Newsletter.
New accounts only. By submitting your email you agree to our Privacy Policy
Scale up as you grow — whether you're running one virtual machine or ten thousand.
Sign up and get $200 in credit for your first 60 days with DigitalOcean.*
*This promotional offer applies to new accounts only.