How to pinpoint the PDO error in PHP7? Here is a code sample that may come to your help.
First, we get a “pdo.connect.php” file. Next, we will use that file to elegantly catch our errors!
Edgar F Codd had invented it. Later it became exceptionally popular. The relational database management system (RDBMS) is a database management system based on the relational model. Today most databases use it.
MySQL is one of them. Along with PHP, we need to know about MySQL for one reason. MySQL is a central component of the LAMP open-source web application software stack. The LAMP is an acronym for “Linux, Apache, MySQL and Perl/PHP/Python”.
How important MySQL is? Well, it really needs no introduction. Many popular applications, such as WordPress, Drupal or Joomla use it. Many high scale websites including Google, Facebook, Twitter, Flickr and YouTube draw on it.
Since the 1980s it has been a common practice for storage of information in databases used for different types of applications. From financial records to personal data – it’s much easier to implement and administer. RDBMS like MySQL maintain a clearer division between the database model and the application. RDBMS as MySQL received challenges, mainly, from two sectors – one is Object Database Management Systems ODBMS or OODBMS and the second one is XML database management system. However, they were unsuccessful.
As time passes by and the horizontal scaling of the computer clusters become popular, NoSQL is one of the most serious challenges RDBMS faces now.
Relational databases use tabular relations. The NoSQL databases use a data structure that consists of key-value, wide column graph or document. It is not only different from RDMS, but sometimes it is also faster. Sometimes people view it as more flexible.
You need a good IDE to develop your projects. If you are a JAVA, C/C++, or PHP developer, Netbeans comes in handy.
For Windows and MAC there are separate guides and they are more GUI based. However in Ubuntu, I’d suggest you to better take the terminal route.
First of all you need to have at least 14 onwards Ubuntu version. The 12 version-updates are stopped since April, 2017.
As you know Adminer is a parallel powerful database handling engine that works like phpMyAdmin.
Often we encounter a problem.
While upgrading our Linux system, we need to update the PHP or MySQL version. While doing this When we type: http://localhost/adminer.php to open Adminer, we encounter an error like this:
None of the supported PHP extensions (MySQLi, MySQL, PDO_MySQL) are available.
To handle this common error what can be done?
It can be solved by taking only two steps.
sudo apt-get install php7.0-mysqlnd
Next you have uncomment one line in ‘/etc/php/7.0/apache2/php.ini’. To do that open it in any editor;
sudo gedit /etc/php/7.0/apache2/php.ini
And just uncomment this line in Linux:
For Windows uncomment this line:
That is all your Adminer will work fine.
First download the latest Adminer into your Apache web servers root folder using this command:
sudo mkdir /usr/share/adminer
sudo wget "http://www.adminer.org/latest.php" -O /usr/share/adminer/latest.php
sudo ln -s /usr/share/adminer/latest.php /usr/share/adminer/adminer.php
echo "Alias /adminer.php /usr/share/adminer/adminer.php" | sudo tee /etc/apache2/conf-available/adminer.conf
Next you need two more lines:
sudo a2enconf adminer.conf
sudo service apache2 restart
Now open your browser and type: