I have included the php.ini file in folder public_html and pasted the mysqli extension. Still the problem is not solved. I updated my PHP and MySQL to the latest possible versions. My server is a dedicated server and not a shared one. I don't want to use the old MySQL function.
Versions
MY PHP version: 5.4.33
MySQL version: 5.5.45-cll.
Create a test page and print the phpinfo() and check if mysqli is enabled or not in your system.
If installed and disable then enable that using php.ini
If not installed in your system then install
**Mysqli Installation ** http://php.net/manual/en/mysqli.installation.php
Related
I installed oracle 11g and I did create some tables and manipulate it using sql developer, and I am looking for a way to connect oracle with php on hosting site.
I tried but I get error after using this code:
$Conexion_ID =oci_connect($OracleUser, $OraclePassw, $OracleIP);
this is the error:
Call to undefined function oci_connect()
I've known that I should install and configure OCI8, so I downloaded this file:
http://www.oracle.com/technetwork/database/features/instant-client/index-097480.html
but I don't know in which folder should I them to make the connection work well.
Download the PHP Extension from here(Confirm the PHP Version and download for the same, the thread safe[TS] version):
http://pecl.php.net/package/oci8/2.0.8/windows
You should be able to find three .dll's
php_oci8.dll, php_oci8_11g.dll and php_oci8_12c.dll
Place all dll's in extension directory, in WAMP it is generally wamp\bin\php\php5.*.*\ext
open the php configuration from the System try of wamp server and add the line:
; Enable only which is required
;extension=php_oci8.dll
extension=php_oci8_11g.dll
;extension=php_oci8_12c.dll
Restart the Apache server.
EDIT : Sorry I thought the other dll's are the libraries, but instead they are for different oracle versions. In your case enable 11g. Answer updated.
Update 2016-11-07: just wanted to say that latest package can be found here https://pecl.php.net/package/oci8. When I wrote this answer 2.0.8 was latest i guess.
if you are using wamp server on windows than you have to use the php_oci8.dll not the oci8.so. You need to download php_oci8.dll and copy it to ext directory under the PHP. If you don't have this extension in your PHP than install it and go to php.ini and add extension=php_oci8.dll.
Please make sure that wamp server have two php.ini files you have to change it on both the places. once everything is done than check with php info that oci 8 installed or not.
I Have installed Moodle Version MOODLE_39_STABLE following the original documentation: https://docs.moodle.org/310/en/Step-by-step_Installation_Guide_for_Ubuntu
During the installation of Moodle, I am facing the issue
Error: database driver problem detected.The site administrator should
verify the server configuration PHP has not been properly configured
with the MySQLi extension for it to communicate with MySQL. Please
check your php.ini file or recompile PHP.
I have gone through several forums, StackOverflow tasks enabled php7.4_mysql extension uncommented the extension=mysqlnd.so in my php.ini file restarted the apache server but there is no use.
Please let me know what exactly I am doing wrong.
Server: Ubuntu 18.04
Web server: Apache2
Php : Php 7.4
Moodle Version: Moodle 39_stable
It seems you have mysql extension installed and you need mysqli (i stands for improved) extension: https://www.php.net/manual/en/book.mysqli.php
i wish to fire select query for login on user table .
i am using php and ms msql server 2005 as backend
my php code is correct but my database is on other p.c in network.
i need to know is there any configuration setting needed to be done. i am using xampp V 1.8.3 including php 5.5.1
To install SQLSRV 3.0 to Apache (I assume) in Windows platform, here are the steps:
Put the driver file in your PHP extension directory.
Modify the php.ini file to include the driver. For example: extension=php_sqlsrv_53_nts_vc9.dll
Restart Apache
Then, verify the installation using phpinfo().
Reference: TechNet
im on ubuntu12.10 using xampp 1.8.1
i was working on a symfony2 project on a windows machine and im currently working on same project from ubuntu machine.
the problem is when i run commands like
php app/console doctrine:schema:update
it gives error
PDO exception:could not find driver
whereas i checked my phpinfo and pdo_mysql is enabled.also there are many select and insert queries in my project which are working fine.
also when i run php -m it shows only PDO and not pdo_mysql
is something wrong with the enviornment variable or something like that?
Its possible that the pdo_mysql extension is not enabled in your php CLI ini file.
Check your ini file for the pdo_mysql extension, you can get your ini file location from php --ini. On ubuntu it should output a list of all loaded ini files, look for
/etc/php5/cli/conf.d/pdo_mysql.ini
and
/etc/php5/cli/conf.d/pdo.ini
If either of these two ini files are not listed, then you haven't installed that extension. If they are present, then make sure they extension is enabled inside those ini files.
Make sure you enable the extensions php_pdo_mysql and php_pdo on php.ini file that your symfony project is using, check this on localhost/path_to_your_project/web/config.php
Tip: check out you Apache error log, there could be something wrong with the load of your extensions. This file is located according to your server configuration.
I am having apache 2.2.14, php 5.3.1 and mysql 5.1.43 installed on vista. I am trying since 2 days to configure php to have mysql enable on phpinfo().
I modified php.ini to have extension_dir = "c:\php\ext"
modified the extension as extension="php_mysql.dll"
added "c:\php" to the "PATH" environment variable and restarted the vista.
after trying many combinations of putting php.ini, php_mysql.dll and libmysql.dll in c drive and/or c:/windows and/or c:/windows/system32 now I am with no options!!
I do restart the apache after each modification. I used libmysql.dll present in mysql installation and that of older php version as php 5.3.1 has no libmysql.dll...
Any help will be appreciated.
Thanks in advance.
You have to edit php.ini and add/uncomment a line to import the php_mysql.dll extention. Search for ;extention=php_mysql.dll and remove the ;. If you find this line without the ; in front of it, you have another problem. If you don't find this line, add it without the ;.
You can also try to put a \ after the extention path: extension_dir="c:\php\ext\"
put php_mysql.dll in the "c:\php\ext" directory (and keep the extension="php_mysql.dll" uncommented [without the leading ;])
Make sure you've edited the right php.ini. In case of doubt
<?php echo 'ini= "', get_cfg_var('cfg_file_path'), '"';
will tell you which one is used by your php installation.
Maybe php tried to load the php-mysql extension and failed because of additional dependencies. That would cause a startup error entry in the error.log.
Which php-build do you use? The php-mysql extension can either use libmysql.dll as transport layer or the new mysqlnd (MySQL native driver) module. You've added c:\php to PATH. That's usually done in order to let windows find libmysql.dll (though it's not necessary, there are other methods which I prefer). If php-mysql depends on libmysql.dll and windows can't find it loading php_mysql.dll will fail.
But if you're using the php.net build of php 5.3.1 the mysql module uses mysqlnd:
Installation on Windows
In the official PHP distributions from 5.3 onwards, MySQL Native Driver is enabled by defaultThis module is built-in in the php.net build. You can test that by calling php -m in a command shell. It prints all built-in modules.
Thanks a lot to the user who said that we have to move the file php.ini to the folder /bin of the Apache server. it resolves me the same problem after more than one week of trying failed methods.
Of course we must uncomment in the file the two lines;
;extension=php_mysql.dll
;extensin_dir="ext"
by removing the semi-colon (;) and by specifying the full path for the extension library php_mysql.dll rather than ext as follows
extension=php_mysql.dll
extensin_dir="c:\Apache22\php53\ext"
For me I installed Apache in the folder c:\Apache22 and PHP in the folder c:\Apache22\php53, you must use your own values.
NOTE: Because mysql_ functions like mysql_connect() become deprecated in PHP 5.5 and above, it is recommended to enable also the library php_mysqli.dll to use functions like mysqli_ (improved version of mysql_ functions). To do that it is simple, you just have to uncomment the line:
;extension=php_mysqli.dll
in the file PHP.ini as follows:
extension=php_mysqli.dll
Update April 7, 2013. Installed Windows 8 on an i7 Quad, HT 8, 3.62GHz, 12GBRAM.. Installed the latest version of MySQL, got it functioning properly. Installed the latest version of Apache Web Server, got it functioning properly. Installed the latest version of PHP, got it functioning properly. MySQL could not connect to the database. The error message was "mysql_connect function undefined". I copied the modified php.ini file into the "C:\Program Files (x86)\Apache Software Foundation\Apache2.2\bin", and restarted Apache web server... then it all magically started working.!!! I hope this helps somebody with setting up their own Windows MySQL / PHP web server.