I have 2 different php versions running. They are running fine but they are not connected to mysql and I dont know why. They should be and I dont know how I can force them to connect with mysql.
The php versions are 5.3.27 and 5.4.31
If u need any more information, let me know.
Please use the following command to install mysql client for php and enable it in php.ini
sudo apt-get install mysql-server libapache2-mod-auth-mysql php5-mysql
Make sure to restart apache (or any web server you are using) before you try to see any changes.
Digital Ocean provides easy guides on installing LAMP environment. Have a look here https://www.digitalocean.com/community/tutorials/how-to-install-linux-apache-mysql-php-lamp-stack-on-ubuntu
It's working now. I just mistyped "extension=mysql.so" :/
Anyways thanks for trying to help!
Related
I'm at a loss.
I tried every single instruction on the internet, I can't seem to install and run memcached on my xampp server.
I'm using a mac. I installed memcached via brew and updated the php.ini file with extension=memcached.so
When I check with phpinfo(); I see that there is no memcached installed.
Could someone please instruct me from the very beginning the steps I needed to take in order to run this on my local with xampp? Or hint me what I'm missing?
Many thanks!
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!
I am having some trouble using BREW on my local host server. I installed brew via Terminal on my Mac and installed FREETDS using brew. I have also changed my default PHP to the MAMP PHP.
Running which php gives:
which php
/Applications/MAMP/bin/php/php7.0.0/bin/php
But it seems the packages I install via brew don't take effect on the MAMP PHP SERVER. I cant see the FREETDS driver anywhere in PHPINFO. Any help guys?
Maybe you can try from terminal to run
php --ini
Output will show you loaded ini file for PHP client. Than you can try to edit that ini file and include additional PHP extension if they are installed.
If possible i would suggest to don't use MAMP, but some Vagrant environment.
If you type:
brew info php
You'll see that Homebrew is installing to a separate directory than MAMP (including extensions). You'll need to reconcile the two somehow to get it working correctly, but it may be worth it to configure your machine to serve from Homebrew's version instead of relying on MAMP Pro - otherwise you'll be moving files around.
The problem here lies with me using MAMP. MAMP is not compatible with brew nor does it let me install extensions. The way I got around this was completely ditch MAMP and just go with PHPBREW which is a much more flexible solution and VERY EASY to setup. If you are going to need anything remotely custom (extensions etc.) go for PHPBREW.... it will save you so much time.
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
Sorry for ask this simple question, but I really can't find any useful information for mcrypr extension missing.
I code PHP on my Mac air, at first time. I sucked in every package's building, and every details was gone and crash,so,I reinstall all my OS and upgrade to OS X 10.8.
I read some tutorials about homebrew, second time, after I enable apache and PHP (already in OS X), I download homebrew and install mysql and mcrypt, and put PhpMyAdmin that download from official website in /Library/WebServer/Document/.
The steps I use was:
brew install mysql <= this is command i use , not just describe my action
brew install mcrypt <= command
make mysql startup when booting
add new line: extension = mcrypt.so in php.ini.default and rename to php.ini.
set mysql root name and pw.
Every log about install was right and success, the folder Cellar was there in /usr/local/. Folder mcrypt was there too.
But when I login phpMyAdmin,still find the line: mcrypt extension is missing still there
Some step I miss or, I add wrong line in php.ini?
And another question, if we install mysql by homebrew, and the charset will set to UTF-8 automatically? Cause my system show me this before i edit my.cnf :(
You should restart Apache so it can notice the newly-installed PHP extension.
Finally ...... I find a answer for my question.
In this Post,even question in this post was different from mine,but there is a very important idea I forgot.
At last , I use macports to create the same environment of PHP+Apache at /opt/local/xxxx/xxx
,homebrew is different from macports,macports didn't depend system's lib or files as much as possible,so I try to use macports and install mcrypt by:
sudo port install php5-mcrypt
when it's done,I copy crypt.so to php/extension/xxxx/xxxx , and it's work finally,maybe someone can reference this kind of answer :)