@php artisan package:discover error on CentOS 8 #1421

Closed
opened 2026-02-05 00:51:20 +03:00 by OVERLORD · 1 comment
Owner

Originally created by @Mant1kor on GitHub (Oct 25, 2019).

Describe the bug
I've try to create installation script on CentOS 8.
I solved almost all problems, but I can't do anything with during installation problem:

+ php composer.phar install
> php -r "!file_exists('bootstrap/cache/services.php') || @unlink('bootstrap/cache/services.php');"
> php -r "!file_exists('bootstrap/cache/compiled.php') || @unlink('bootstrap/cache/compiled.php');"
Loading composer repositories with package information
Installing dependencies (including require-dev) from lock file
Package operations: 112 installs, 0 updates, 0 removals
  - Installing vlucas/phpdotenv (v2.5.2): Downloading (100%)
...
...
  - Installing squizlabs/php_codesniffer (3.4.0): Downloading (100%)
symfony/var-dumper suggests installing ext-symfony_debug
...
...
phpunit/phpunit suggests installing phpunit/php-invoker (^1.1)
Generating optimized autoload files
> Illuminate\Foundation\ComposerScripts::postAutoloadDump
> @php artisan package:discover


  [Symfony\Component\Debug\Exception\FatalThrowableError]
  Class 'PDO' not found


Script @php artisan package:discover handling the post-autoload-dump event returned with error code 1

Steps To Reproduce
Steps to reproduce the behavior:

  1. Install CentOS 8
  2. Run installation script

Your Configuration (please complete the following information):

  • PHP Version: 7.3
  • Hosting Method: Nginx or Apache
  • OS: CentOS Linux release 8.0.1905 (Core)

Additional context
With PHP 7.2 the problem almost the same:

+ php composer.phar install
> php -r "!file_exists('bootstrap/cache/services.php') || @unlink('bootstrap/cache/services.php');"
> php -r "!file_exists('bootstrap/cache/compiled.php') || @unlink('bootstrap/cache/compiled.php');"
Loading composer repositories with package information
Installing dependencies (including require-dev) from lock file
Package operations: 112 installs, 0 updates, 0 removals
  - Installing vlucas/phpdotenv (v2.5.2): Downloading (100%)
...
...
  - Installing squizlabs/php_codesniffer (3.4.0): Downloading (100%)
symfony/var-dumper suggests installing ext-symfony_debug
...
...
phpunit/phpunit suggests installing phpunit/php-invoker (^1.1)
Generating optimized autoload files
> Illuminate\Foundation\ComposerScripts::postAutoloadDump
> @php artisan package:discover
PHP Fatal error:  Class 'PDO' not found in /var/www/bookstack/vendor/laravel/framework/src/Illuminate/Database/Connection.php on line 1236


  [Symfony\Component\Debug\Exception\FatalErrorException]
  Class 'PDO' not found


Script @php artisan package:discover handling the post-autoload-dump event returned with error code 255
Originally created by @Mant1kor on GitHub (Oct 25, 2019). **Describe the bug** I've try to create installation script on CentOS 8. I solved almost all problems, but I can't do anything with during installation problem: ``` shell + php composer.phar install > php -r "!file_exists('bootstrap/cache/services.php') || @unlink('bootstrap/cache/services.php');" > php -r "!file_exists('bootstrap/cache/compiled.php') || @unlink('bootstrap/cache/compiled.php');" Loading composer repositories with package information Installing dependencies (including require-dev) from lock file Package operations: 112 installs, 0 updates, 0 removals - Installing vlucas/phpdotenv (v2.5.2): Downloading (100%) ... ... - Installing squizlabs/php_codesniffer (3.4.0): Downloading (100%) symfony/var-dumper suggests installing ext-symfony_debug ... ... phpunit/phpunit suggests installing phpunit/php-invoker (^1.1) Generating optimized autoload files > Illuminate\Foundation\ComposerScripts::postAutoloadDump > @php artisan package:discover [Symfony\Component\Debug\Exception\FatalThrowableError] Class 'PDO' not found Script @php artisan package:discover handling the post-autoload-dump event returned with error code 1 ``` **Steps To Reproduce** Steps to reproduce the behavior: 1. Install CentOS 8 2. Run [installation script](https://github.com/Mant1kor/devops/blob/master/scripts/installation-CentOS-8.sh) **Your Configuration (please complete the following information):** - PHP Version: 7.3 - Hosting Method: Nginx or Apache - OS: CentOS Linux release 8.0.1905 (Core) **Additional context** With PHP 7.2 the problem almost the same: ``` shell + php composer.phar install > php -r "!file_exists('bootstrap/cache/services.php') || @unlink('bootstrap/cache/services.php');" > php -r "!file_exists('bootstrap/cache/compiled.php') || @unlink('bootstrap/cache/compiled.php');" Loading composer repositories with package information Installing dependencies (including require-dev) from lock file Package operations: 112 installs, 0 updates, 0 removals - Installing vlucas/phpdotenv (v2.5.2): Downloading (100%) ... ... - Installing squizlabs/php_codesniffer (3.4.0): Downloading (100%) symfony/var-dumper suggests installing ext-symfony_debug ... ... phpunit/phpunit suggests installing phpunit/php-invoker (^1.1) Generating optimized autoload files > Illuminate\Foundation\ComposerScripts::postAutoloadDump > @php artisan package:discover PHP Fatal error: Class 'PDO' not found in /var/www/bookstack/vendor/laravel/framework/src/Illuminate/Database/Connection.php on line 1236 [Symfony\Component\Debug\Exception\FatalErrorException] Class 'PDO' not found Script @php artisan package:discover handling the post-autoload-dump event returned with error code 255 ```
OVERLORD added the 🐕 Support label 2026-02-05 00:51:20 +03:00
Author
Owner

@ssddanbrown commented on GitHub (Oct 26, 2019):

Hi @Mant1kor,
Just ran the script in a VM. From my testing I think it's just a case of installing php-mysqlnd which will in turn install the PDO extension.

@ssddanbrown commented on GitHub (Oct 26, 2019): Hi @Mant1kor, Just ran the script in a VM. From my testing I think it's just a case of installing `php-mysqlnd` which will in turn install the PDO extension.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/BookStack#1421