Search code examples
oracle-databaselaravelnginxpdo

Laravel Call to undefined function yajra\Pdo\oci_connect()


I am using nginx with php7-fpm with OCI8 enabled, i test the Oracle connection and it is connecting with a plain PHP script.

After PHP artisan serve the error message is : Fatal error: Call to undefined function yajra\Pdo\oci_connect()

I already comment config/app.php yajra line. Also run php artisan cache:clear, composer dump-autoload and composer update uncomment and run all commands again

How can i fix this error? Call to undefined function yajra\Pdo\oci_connect()


Solution

  • I ran throw this issue this week and in my case I had added extension=oci8.so to the /etc/php/(version)/apache/php.ini and also to the /etc/php/(version)/cli/php.ini. I commented these two and leave only the one in /etc/php/(version)/fpm/php.ini (I was running laravel with php8.1-fpm), after that php artisan cache:clear and php artisan config:cache.