Symfony SQLite3 and PDO drivers - php

I'm running Symfony but it doesn't find pdo drivers and the demo application throws exception of SQLite3 exceptions.
The configuration checkers says:
PDO should have some drivers installed (currently available: none)
Install PDO drivers (mandatory for Doctrine).
But in php.ini I have:
extension=php_pdo_mysql.dll
extension=php_pdo_sqlite.dll
extension=php_sqlite3.dll
In the end, the symfony app says:
// Check if SQLite is enabled
if ($isDriverException && $this->isSQLitePlatform() && !extension_loaded('sqlite3')) {
$event->setException(new \Exception('PHP extension "sqlite3" must be enabled because, by default, the Symfony Demo application uses SQLite to store its information.'));
}
But I knew that with PHP 5.3+ it's installed by default.
I'm running on windows with PHP7.1 installed

Related

MySQLi is enabled but not loaded in Windows Server 2008

I've installed PHP5.6, PHP7.0, PHP7.2 in my server with extension=php_mysqli.dll enabled.
The project is written for PHP7.0, able to connect db with PHP5.6, but not in 7.0/7.2
May I know how can i do further testing to find out the problems? No sign of MySQLi in phpinfo().

Mongo db php driver class

My phpinfo() has the following under the mongodb section
mongodb
mongodb support enabled
mongodb version 1.1.7
mongodb stability stable
libmongoc version 1.3.5
libbson version 1.3.5
Mongod is running, but when I try to instantiate the Mongo class I get
Fatal error: Class 'Mongo' not found in ...
Am I missing a step here? I've set up this same environment before and never had this problem.
Also,
Fatal error: Class 'MongoClient' not found in ... as well
You are confusing the Mongo drivers:
Legacy driver (deprecated): mongo.so
Provides the classes you try to intantiate.
Recent driver: mongodb.so
"provides a minimal API for core driver functionality"
With your installed driver, you cannot use the Classes provided by the legacy driver.

Mac OS X MongoDB and MONGO PHP DRIVER

i try to install MongoDB and Mongo PHP Driver for 5.6.x for MAMP PRO , but i finishing installation (also i add extension on php.ini) but still doesn't work. Any one help me ?
it would be useful if you could give more information about versions (MAMPP version, MongoDB server version, Mongo driver version...).
However the most common problem with Mongo and php is that there are two different drivers, both can be installed through PECL.
mongo-php : Legacy driver, not recommended anymore.
sudo pecl install mongo
Add to php.ini -> extension=mongo.so
mongodb-php : New driver, recommended.
sudo pecl install mongodb
Add to php.ini -> extension=mongodb.so
While mongo-driver works with PHP versions < 7.0 mongodb driver works with PHP versions > 5.5. But some libraries are still using old mongo driver (i.e.doctrine) and could need an adapter if you want to work with the new driver.
Old driver repo: https://github.com/mongodb/mongo-php-driver-legacy
New driver repo: https://github.com/mongodb/mongo-php-library
To be sure which driver is working in your system, you can perform this easy test. Create two PHP scripts with the following initialization:
If this works then you have old driver installed
$connection = new MongoClient({here your conn data})
If this works then you have the new driver installed
$connection = new MongoDB\Driver\Manager({here your conn data})
Hope this will be useful for any user with the same problem on any platform.
(Please note the extension for windows user will be .dll instead of .so)

how to enable PDO_OCI in whm cPanel

I tried to enable PDO_OCI in whm cPanel through software -> Module insataller -> PHP Pecl but it shows error like
WARNING: "pear/PDO_OCI" is deprecated in favor of "channel://http://www.php.net/pdo_oci/ext/pdo_oci" pear/PDO_OCI requires PHP extension "pdo" (version >= 1.0) No valid packages found install failed The PDO_OCI.so object is not in /usr/local/lib/php/extensions/no-debug-non-zts-20100525 Tidying /usr/local/lib/php.ini... No changes Tidying /usr/local/cpanel/3rdparty/php/54/etc/php.ini... No changes
Then i tried to install PDO and shows
WARNING: "pecl/PDO" is deprecated in favor of "channel://http://svn.php.net/viewvc/php/php-src/trunk/ext/pdo//ext/PDO" downloading PDO-1.0.3.tgz ... Starting to download PDO-1.0.3.tgz (52,613 bytes) .............done:
So please help me how can i enable PDO_OCI in my WHM cPanel.
When trying to print phpinfo() from my server it shows PDO is enabled.
If you got that far, you may just need to load the pdo_oci extension in cPanel's PHP configuration:
WHM -> Service Configuration -> PHP Configuration Editor
Advanced Mode
Find the "extension" section and add pdo_oci.so to the comma
separated list Save the PHP configuration
Check phpinfo() again - you should see pdo_oci available
If that does not work and you still have issues, you can always build the new (non-pecl) pdo_oci into cPanel's PHP manually as follows:
Ensure you have the Basic and Devel Instant Client installed (http://www.oracle.com/technetwork/topics/linuxx86-64soft-092277.html)
Create (or update) the rawopts file (example: /var/cpanel/easy/apache/rawopts/all_php5) for your PHP version to include this line: ---with-pdo-oci=shared,instantclient,/usr,12.1 (assuming you installed version 12.1 of the Oracle Instant Client using RPM)
In our case, the PHP LDAP module was checked in EasyApache, so I had to remove the LDAP module from the instant client install to prevent a conflict during compilation: rm /usr/include/oracle/12.1/client64/ldap.h
Rebuild your profile in EasyApache
If successful, add pdo_oci.so to the PHP configuration as outlined above
As noted, these steps are only applicable to cPanel.

Wamp2 x86 PHP 5.4 TS - sqlsrv module not loading

I see that many people had issues like that, however I could not find solution that would just work.
My phpinfo() says:
PHP Version 5.4.16
Server API Apache 2.0 Handler
Thread Safety enabled
I've downloaded: http://sqlsrvphp.codeplex.com/
readme says that if I have PHP 5.4 TS I should load those files:
php_sqlsrv_54_ts.dll
php_pdo_sqlsrv_54_ts.dll
I've loaded above, but only PDO extension seems to work fine:
PDO support enabled
PDO drivers mysql, sqlite, sqlsrv
pdo_sqlsrv support enabled
However I can not see sqlsrv extensions anywhere.
I've checked PHP error.log and it's also empty.
Do you have idea why those MS libs does not work and how can I debug it?
I've small project on Windows and configuring ones stack seems to be pretty hard comparing to Linux.

Categories