Recently i installed LAMP on Linux Mint. I successfully installed it and now just run this commands on terminal for checking the version :
apache2 -v
php -v
mysql -v
This is the result :
I dont have any problem with localhost because now i'm running phpinfo() function correctly and localhost (apache and php) is ok. but for database is that :
in orther to instal phpmyadmin you need to install mysql before cotinunig
so it said that MySQL is needed. as you see i had installed mySQL before and now i have problem with checking the version.
im trying to config phpmyadmin but here is:
so i think this is the cause of mySQL.
what is the problem ?
As the mysql extension is not part of a default PHP7 installation anymore (http://php.net/manual/de/mysql.php), you need to install it with
sudo apt-get install php-mysql
This should install and activate the mysql drivers. You will have to restart apache afterwards by
sudo service apache2 restart
If you have already the mysql package installed, check the php.ini under /etc/php/7.1/apache2/php.ini for the line
extension=mysql.so
Maybe phpmyadmin works with mysqli (extension=mysqli.so) too.
To install php7 and php5 in parallel, check out this guide:
http://lornajane.net/posts/2016/php-7-0-and-5-6-on-ubuntu
I have already solved this problem by searching for a long time.
Everytime for the first time you use mysql after you turn on the computer,you should execute the following sentence:
net start mysql80
80 is mysql's version.
Remember:you should run the cmd with administrator privileges
Best wishes!
Related
I have been struggling with this error for quite sometimes and I am wondering if someone could help me get this running
I have
php -v 7.2.24
mysql -v 8.0.21
Apache 2.4.37
redhat 8.4
it keeps giving me the same error, I have removed and reinstalled php or mysql but didnt solve the issue. I also found other posts and i let the php.ini to have extension=mysqli still the same error.
I tried to have a index.php to the DNS and it shows that there is not any mysql section
any idea?
Probably, you need to install the MySQL extension for PHP:
# yum install php-mysql
Then restart Apache
# service httpd restart
Hello I'm new in Linux and sorry if this subject already exist,
I know that with php and Linux you can start a local server with the commande
php -S 127.0.0.1:8080
I just wanted to know if we can work with a local database in this way with Linux
PS: I don't want to install Xampp
Sure, you can install an local MySQL Server. If you are running Ubuntu/Debian here we go:
Install MySQL and PHP Modules
sudo apt-get install mysql-server php5-mysql
Finish Setup with:
sudo /usr/bin/mysql_secure_installation
Thats it!
I am starting to use laravel 4 and I am trying to start using unit tests so I can make my live easier. Well as all of you will guess my development hasn't become easier after trying phpunit tests. The simple tests are well, easy but when the things start to get a bit more complicated they does not go as I though they will.
The problem is I have conducted simple tests but I get some strange error PDOException: could not find driver. I have read a few articles and post on this topic but nothing solved my problem. I have installed php5-mysql and when I call php -m it says that I have both PDO and pdo_mysql. The actual command I use is php -m |grep -i "pdo" and the output is:
PDO
pdo_mysql
Well I've tried to actualy test PDOException class in the browser. For that purpose I have change the mysql user password to incorrect one and tested what will happen in artisan server (called with command php artisan serve ---> http://localhost:8000/). In the browser everything works as a charm but when I try to call ``phpunit` in the console the result is not the same.
I have tried to see if webserver and cli have different configuration files but it turnout that the files are identical. The configuration files that I have compared are:
for the web server
/etc/php5/apache2/conf.d/20-pdo_mysql.ini
/etc/php5/apache2/conf.d/05-opcache.ini
/etc/php5/apache2/conf.d/20-json.ini
/etc/php5/apache2/conf.d/20-mysql.ini
/etc/php5/apache2/conf.d/20-mysqli.ini
/etc/php5/apache2/conf.d/10-pdo.ini
/etc/php5/apache2/conf.d/20-mcrypt.ini
/etc/php5/apache2/conf.d/20-curl.ini
/etc/php5/apache2/php.ini
for command line
/etc/php5/cli/conf.d/20-pdo_mysql.ini
/etc/php5/cli/conf.d/05-opcache.ini
/etc/php5/cli/conf.d/20-json.ini
/etc/php5/cli/conf.d/20-mysql.ini
/etc/php5/cli/conf.d/20-mysqli.ini
/etc/php5/cli/conf.d/10-pdo.ini
/etc/php5/cli/conf.d/20-mcrypt.ini
/etc/php5/cli/conf.d/20-curl.ini
/etc/php5/cli/php.ini
to compare them I user the diff command like so diff -s /path/to/file1 /path/to/file2.
The errors look like this:
1) ExampleTest::testBasicExample
PDOException: could not find driver
/var/www/smlsspd/vendor/laravel/framework/src/Illuminate/Database/Connectors/Connector.php:47
/var/www/smlsspd/vendor/laravel/framework/src/Illuminate/Database/Connectors/SQLiteConnector.php:22
/var/www/smlsspd/vendor/laravel/framework/src/Illuminate/Database/Connectors/ConnectionFactory.php:59
/var/www/smlsspd/vendor/laravel/framework/src/Illuminate/Database/Connectors/ConnectionFactory.php:47
/var/www/smlsspd/vendor/laravel/framework/src/Illuminate/Database/DatabaseManager.php:127
/var/www/smlsspd/vendor/laravel/framework/src/Illuminate/Database/DatabaseManager.php:63
/var/www/smlsspd/vendor/laravel/framework/src/Illuminate/Database/Migrations/DatabaseMigrationRepository.php:167
/var/www/smlsspd/vendor/laravel/framework/src/Illuminate/Database/Migrations/DatabaseMigrationRepository.php:135
/var/www/smlsspd/vendor/laravel/framework/src/Illuminate/Database/Migrations/Migrator.php:366
/var/www/smlsspd/vendor/laravel/framework/src/Illuminate/Database/Console/Migrations/MigrateCommand.php:93
/var/www/smlsspd/vendor/laravel/framework/src/Illuminate/Database/Console/Migrations/MigrateCommand.php:56
/var/www/smlsspd/vendor/laravel/framework/src/Illuminate/Console/Command.php:108
/var/www/smlsspd/vendor/symfony/console/Symfony/Component/Console/Command/Command.php:241
/var/www/smlsspd/vendor/laravel/framework/src/Illuminate/Console/Command.php:96
/var/www/smlsspd/vendor/laravel/framework/src/Illuminate/Console/Application.php:96
/var/www/smlsspd/vendor/laravel/framework/src/Illuminate/Foundation/Artisan.php:57
/var/www/smlsspd/vendor/laravel/framework/src/Illuminate/Support/Facades/Facade.php:208
/var/www/smlsspd/vendor/laravel/framework/src/Illuminate/Support/Facades/Facade.php:208
/var/www/smlsspd/app/tests/TestCase.php:70
/var/www/smlsspd/app/tests/TestCase.php:70
/var/www/smlsspd/app/tests/TestCase.php:46
phar:///var/www/smlsspd/phpunit.phar/phpunit/TextUI/Command.php:179
phar:///var/www/smlsspd/phpunit.phar/phpunit/TextUI/Command.php:132
Can you give me a hint or solution to this problem?
Thank you for your time :)
It seems Laravel using SQLite as database for testing. See the backtrace at line 2:
/var/www/smlsspd/vendor/laravel/framework/src/Illuminate/Database/Connectors/SQLiteConnector.php:22
But this seems not installed on your system. So I think you need to install the SQLite driver.
If you are using sqlite for testing you will need php sqlite drivers
For Ubuntu 14.04
sudo apt-get install php5-sqlite
sudo service apache2 restart
In ubuntu 16.04 there is no php5-sqlite
sudo apt-get install php7.0-sqlite
sudo service apache2 restart
If you are occupying SqLite you have to enter php.init and uncomment this line.
;extension = pdo_sqlite
On Windows i had to activate extension=php_pdo_sqlite.dll in php.ini.
For those using Laravel Homestead, make sure you're running phpunit from within Homestead and not on your local machine! You can SSH into it with vagrant ssh.
As others have mentioned, it requires SQLite and thus running it within your virtual machine ensures that's available to your test.
php7.0-sqlite no longer works use php7.1-sqlite
sudo apt-get install php7.1-sqlite3
sudo service apache2 restart
first, install SQLite for PHP with
sudo apt-get install php-sqlite3
then check your php.ini and make sure the below line is uncommented
;extension = pdo_sqlite
then if you are using apache
sudo service apache2 restart
or if you are using Nginx
sudo service nginx restart
note: if you don't know where is your php.ini path use php -i |grep php.ini command
In Laravel, in phpunit.xml file, just set "DB_CONNECTION" and "DB_DATABASE" values. Since I was using mysql (not sqlite), I changed them like this:
<server name="DB_CONNECTION" value="mysql"/>
<server name="DB_DATABASE" value="db_name"/>
If using mysql, add this line in phpunit.xml:
<server name="DB_CONNECTION" value="mysql"/>
Then install the mysql package in php
$ apt-get install php-mysql
Try again :)
I have been trying to figure out for three days why I cannot connect to my Database so I can install Joomla.
I have PHP Installed and in my '.ini' File:'php.ini-development' file I do have mysql and mysqli installed:
I have my SQLServer and Database Connected I am using WorkBench to manage it FYI.
Yet I keep getting this message and I don't have any Database Types in the selection box:
Yes, I have seen many forums on here and everywhere I have been researching it for three days now, although everything has not worked for me. So if you would please help me!
PS: I do have 'public $dbtype = 'mysql';' in my configuration file, so please don't say to do that because that was almost half of what the forums have said. I also have IIS7 installed and running for another website, I don't know if that could be the problem or not if it were interfering with SQL.
In my case, below packages were missing:
- libapache2-mod-auth-mysql
- php5-mysql
I installed them by sudo apt-get install libapache2-mod-auth-mysql php5-mysql and restarted the apache2 & mysql service.
In my case, the problem was on the extension directory configuration, on php.ini. I discovered that, when joomla installation can't access the MySQL extension, or others database extensions, the database is not showed. My property extension_dir was set to the wrong directory, so the PHP wasn't able to load any extension, and of course, joomla installation wasn't able to show any database types to be choosen.
You can search for "extension_dir" property on php.ini file and check if its value is right.
On my CentOS 7 there was "php-pgsql" missing (for PostgreSQL database). Installing it resolved the problem.
\# sudo yum install php-pgsql
\# sudo tail -1 /var/log/yum.log
Dec 21 19:33:35 Installed: php-pgsql-5.4.16-36.el7_1.x86_64
in my case, mysql, the package php-mysql is missed
using this command and then restart apache2
sudo apt install php-mysql
sudo service apache2 restart
I am trying to install phpmyadmin on a VPS LEMP-stack.
I created an info.php, which is perfectly reachable when I call my server's IP in my browser, revealing all relevant php-info, i.e. nginx is running.
However, after installing phpmyadmin, which I try to access via http://192.xxx.xxx.x/phpmyadmin/, I get the following error message:
The mysqli extension is missing. Please check your PHP configuration.
I already installed php5-mysql via sudo apt-get install php5-mysql, restarted nginx and cleared my browser-cache, but the situation remains.
Could you please advice me what goes wrong?
mysql and mysqli are two different things.
You have to install the mysqli library:
sudo apt-get install php5-mysqli
Don't forget to also restart the php fpm workers, because that's where the mods get loaded, not in nginx.
/etc/init.d/php5-fpm restart
Update:
I was wrong, the php5-mysql package contains the mysql AND the mysqli library.
It must be enough for you to restart the php workers :-)