After compiling php typing
./configure --with-apxs2=/usr/local/apache2/bin/apxs --with-pdo-mysql
I could succesfully connect to the database, but then I enabled the openssl and mbstring extensions
I typed
./configure --with-openssl --with-apxs2=/usr/local/apache2/bin/apxs
and
./configure --with-apxs2=/usr/local/apache2/bin/apxs --enable--mbstring --with-libmbfl
Now I'm unabled to connect php with mysql.
This is the code I'm using:
?php
$username = "phptest";
$servername = "localhost";
$password = "cucaramacara";
$dbname = "phpsampledb";
try{
$conn = new PDO("mysql:host=$servername;dbname=$dbname", $username, $password$
//set the PDO
$conn->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
echo "Connected succesfully";
}
catch(PDOException $e){
echo "Connection failed:".$e->getMessage();
}
?>
When I type php on the terminal it displays:
PHP Warning: PHP Startup: Unable to load dynamic library '/usr/local/lib/php/extensions/no-debug-zts-20131226/pdo_mysql.so' - /usr/local/lib/php/extensions/no-debug-zts-20131226/pdo_mysql.so: cannot open shared object file: No such file or directory in Unknown on line 0
./configure --with-apxs2=/usr/local/apache2/bin/apxs --with-pdo-mysql --with-openssl --enable--mbstring --with-libmbflIt should be one command, not 3.