简体   繁体   中英

Laravel 5.7 cannot connect to mysql after php upgrade to 7.4

I have a laravel 5.7 installation running on Ubuntu 18 on EC2 and MYSQL RDS. I have upgraded my PHP from 7.2 to 7.4. The site runs but pages that pull data from mysql show a 404 error. But if I revert back to PHP 7.2 they work fine. Do I need to make any additional code/configuration changes?

After investigating more, it was a simple fix. I needed to have the mysql driver installed for the latest version of php.

sudo apt install php7.4-common php7.4-mysql php7.4-xml php7.4-xmlrpc php7.4-curl php7.4-gd php7.4-imagick php7.4-cli php7.4-dev php7.4-imap php7.4-mbstring php7.4-opcache php7.4-soap php7.4-zip php7.4-intl -y

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM