I am having difficulty getting PHP(5) on Windows to work with Sqlite. After some research, I found that I have to change the php.ini file so that it reads (without semi-colons):
extension=php_pdo.dll
extension=php_sqlite.dll
I ran the phpinfo() command, and verified that my computer is reading the right php.ini file. Additionally, I have both php_sqlite.dll and php_pdo_sqlite.dll located in an ext file located in the folder with the php.ini file. However, phpinfo indicates that the PDO drivers are "no value", and there is no indication of sqlite anywhere.
I am now stuck, because all of my resources state that the above should work. I noticed that my php.ini file has the following: extension=php_pdo_sqlite.dll and extension=php_sqlite.dll. The "extension=php_pdo_sqlite.dll" is different from "extension=php_pdo.dll" in my above example. I tried removing the extension and adding "extension=php_pdo.dll", but that did not make a difference.
Does anyone know how to resolve this issue?
Thank you,
DFM
As a resolution to this issue, I ended up installing WAMP and using a basic editor, instead of the IDE. The php.ini file was already configured so connecting to Sqlite was pretty much straight forward.
Thanks,
DFM
Related
I am using xampp and in the process of trying to debug with netbeans I am getting "Waiting For Connection". In searching the web I found that the php.ini needs to be edited but I am not sure which one. When I go into the PHP folder through xampp there is php.ini-production and php.ini-development. I read the comments in the file but I still do not understand. Any help is appreciated. Thanks.
I have searched around stack overflow and found the proper code for the ini but it seems there is nothing that shows you how to set the ini up in xampp.
I want to fix the php.ini file so that I can debug with netbeans
Well to find out the location of your php.ini file, you can create a file called phpinfo.php with the following function: phpinfo().
This will display information about your Php installation including the path to the php.ini file.
Also see this related question: How to locate the php.ini file (xampp)
So I have been searching high and low an answer to my problem. Anytime I go here
http://localhost:8888/phpMyAdmin/, I get this error
So I created a php file with phpinfo() and get this
info.php
So then I go to my file explorer and follow the directory
C:\MAMP\conf\php7.1.7
Loaded Configuration File C:\MAMP\conf\php7.1.7\php.ini
Next I opened the php.ini file in sublime to make some changes (C:\MAMP\conf\php7.1.7\php.ini). I believe all the extensions are located at this directory
C:\MAMP\bin\php\php7.1.7\ext
where I think the php extensions are located at
So these are the changes I make to my php.ini file (removing the ; from the front)
1) ;Directory in which the loadable extensions (modules) reside.
extension_dir = "C:\MAMP\bin\php\php7.1.7\ext\"
2) ; Dynamic Extensions.
extension=php_mysqli.dll
I restart my MAMP server every time I make a change and reset my browser as well. And I still get the same "mysqli extension" missing error
I have even tried adding some environment variable paths.....
added two different environment variables
C:\MAMP\conf\php7.1.7
and
C:\MAMP\conf\php7.1.7\php.ini
Also here is my new_connection.php file and code to connect to MySql
new_connection.php
This is what I get when I run the code (showing that both If statements are failing)
mysqli_init function does not exist,
mysqli extension is not loaded
I found this
https://secure.php.net/manual/en/mysqli.installation.php
which states....
PHP 5.3.0 and newer
On Windows, for PHP versions 5.3 and newer, the mysqli extension is enabled and uses the MySQL Native Driver by default. This means you don't need to worry about configuring access to libmysql.dll.
Which confuses me, because the mysqli extension did have a ';' in front when I opened the php.ini file
I used MAMP with PHP version 8.0.1 and the phpMyAdmin-Page always said that it needs mysqli to work. I searched every folder, commented a lot, always refreshed the server and so on but nothing worked...
... until I changed the PHP version to version 8.1.0 in the MAMP-settings and the extension_dir in the php.ini (path should be something like \MAMP\conf\php8.0.1) (the "extension_dir" should be in line 544).
Macbook pro: 10.9.3
Php: 5.4.25
Apache 2.2
I have downloaded php using homebrew along with mongodb. Everything is working fine but I can not seem to find the php.ini file that apache is using. I used the phpinfo() method and it is telling me that the loaded file is in etc/php.ini. Strange thing about that is my php.ini file is empty. The only line in this file is the extension directive for the mongodb driver. I have been searching for a while now using the usual methods such as php -i and phpinfo(). I have no idea how to configure my php. It must be loading default configurations from somewhere but I can not find where. Anyone have any clue to where it might be?
sorry if this is a really silly question. I googled a lot and nothing came up
I have this in my php.ini file:
extension_dir="C:\Program Files\PHP\ext"
enable_dl = on
extension=php_mysql.dll
when I call the phpinfo() function it says that there aren't any loaded modules.
I am using the latest version of apache, php and MySQL in a windows operating systems.
Also, I have used a WAMP server but I prefer having things separately and I want to learn how to do it
Thanks in advance
You need to enable the mysql extension itself in php.ini too. For example if you want to use mysqli, you need to add this to your php.ini file:
extension=php_mysqli.dll
also make sure that you have this dll file in your ext directory.
I'm having trouble calling finfo_open in a PHP script running on Windows Server 2003 with PHP 5.3.5 & IIS 6. The call always returns Fatal error: Call to undefined function finfo_open() in...
Through a little reading I know that fileinfo functionality is not included by default in the windows PHP installation, though nothing I try gets it working. The instructions in comment #3 here: http://www.php.net/manual/en/fileinfo.installation.php didn't help, and that's the most official looking explanation I can find. There's lots of information about needing the mime_magic dll on the web but it seems like this is no longer required as of 5.3. Furthermore, I have read on http://pecl.php.net/package/Fileinfo that "As of PHP 5.3.0 this extension is enabled by default". What's going on?
This issue is on a testing server. On my local machine I have xampp and PHP 5.3.1 and the call works fine, so I also tried copying the php_fileinfo.dll from local to php\ext on testing but this also didn't make any difference (I know that versions are different, but I read that the 5.3 is the important bit).
Any advice on this would be much appreciated!
$finfo = finfo_open(FILEINFO_MIME_TYPE);
$mime = finfo_file($finfo, $filepath);
You're already close to get it done, only some little configuration is missing on your end.
Please see the fileinfo usage and installation instructions:
Windows users must include the bundled php_fileinfo.dll DLL file in php.ini to enable this extension.
That DLL file is bundeled with PHP 5.3.6 for example, you can find the files here: PHP For Windows - Binaries and sources Releases. It should be already located in the ext subdirectory of your PHP installation. If not download it again from the said website (choose your PHP version) and place it into the extension directory.
You need to add the following line your php.ini then to activate it:
extension=php_fileinfo.dll
That's the standard procedure to activate a PHP extension under windows. You can find more information about how to actiave a PHP extension here: Installation of extensions on Windows. If you have problems to locate the php.ini file, please refer to the PHP installation instructions - Installation on Windows systems.
This line
extension=php_fileinfo.dll
was commented in my php.ini so I uncommented it and then restarted my xampp server.
After doing what hakre suggested, the FileInfo extension was still not loaded at my end, but then eventually I solved it by figuring out that the php.ini file I was modifying was the wrong one (that was located at \MAMP\bin\php\php7.2.10) whereas the correct one was located at \MAMP\conf\php7.2.10.
After enabling it in the correct ini file, I had to restart the php server and off it worked.
NOTE: You might have to replace '\MAMP' from the start of the path with the path where your web-server solution stack software (e.g. MAMP, WAMP, XAMP or else) is installed. Since I was using MAMP that's why its present in my file path