1

I am working on Linux Mint. I installed Apache, MySQL, PHP for Laravel and Oracle 11g Express edition. Then to connect Laravel to Oracle I found this on GitHub.

I did everything according to the documentation there. Then while I run php artisan migrate returns me

[Symfony\Component\Debug\Exception\FatalErrorException]
Call to undefined function Yajra\Pdo\oci_connect()

After that I searched on but failed to get anything that work for me. Got two questions with same problem on Stackoverflow not answered yet. From GitHub issue tab, someone told to active a comment in php.ini file. But there are no such thing in my php.ini file.

1
  • Downvoted for undoing a perfectly good edit. Please do not roll back improvement edits, unless they change the meaning of your post. Commented Jan 15, 2016 at 23:40

1 Answer 1

2

It sounds like you don't have oci8 extension installed. You'll need to get Oracle Instant Client basic and sdk zip packages, unpack them to the same directory, create symbolic links

sudo ln -s libclntsh.so.* libclntsh.so
sudo ln -s libocci.so.* libocci.so

Then do pecl install oci8, and provide it with the directory path where you have unpacked the instant client to. It'll compile OCI8 extension on your machine. When it compiles correctly, enable the extension in php.ini:

echo "; configuration for php oci8 module" | sudo tee /etc/php5/conf.d/oci8.ini
echo extension=oci8.so | sudo tee -a /etc/php5/conf.d/oci8.ini

and restart apache. See also this answer, official oracle manual, official php manual or google "linux oci8 pecl howto" for multiple detailed manuals.

Sign up to request clarification or add additional context in comments.

9 Comments

Not working. pecl install oci8 returns installation fail. And says php 7.0.0 or higher is required. I have php5 installed. What to do then?
Try pecl install oci8-2.0.10
Now it returns No releases available for package "pecl.php.net/oci8" install failed
Are you behind a proxy? If yes, see stackoverflow.com/a/33266364/1375470 - otherwise, try pecl -vvv install oci8-2.0.10 to force verbosity.
@MASh You were supposed to look at the output of -vvv to see what causes the error... Either way, you can go to pecl.php.net/package/oci8, download oci8-2.0.10.tgz manually and run pear install oci8-2.0.10.tgz
|

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.