What does xampp expect as a php.ini? - php

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)

Related

Editing php.ini with MAMP 3.5 where is the right ini file?

I'm trying to edit my php.ini file to turn off short tags. Pretty standard.
phpinfo() tells me I am running PHP Version 5.6.10
I have edited 2 php.ini files so far, and neither has taken effect (yes, I restarted MAMP)
MAMP/conf/php5.6.10/php.ini
MAMP/bin/php/php5.6.10/conf/php.ini
Neither file changes the status of short tags
Can anyone direct me where/how to change my php.ini settings?
I really freaking miss WAMP. Whose bright idea was it to buy a Mac?!?
When you run phpinfo() you need to look for the value Loaded Configuration File. This tells you which php.ini file PHP is using in the context of the web server.
Aaannnnnnnnddddd I was being a dufus
I had been commenting the line out instead of changing to "Off"
as you version is 5.6.10, and supposed your apache2 server runing on ubuntu.
php.ini dir is
/etc/php5/apache2/php.ini
On my Mac, running MAMP I have a few locations that would contain the likely php.ini
So I edited the memory_limit to different values in the 2 suspected files,
to test which one effected the actual MAMP PHP INFO page details.
By doing that I was able to determine that this was the correct php.ini:
/Applications/MAMP/bin/php/php7.2.10/conf/php.ini

Unable to change upload_max_filesize in php.ini

Running PhP v. 5.6.12 on localhost after extracting xampp-win32-v. 5.6.12.0-VC.7z through xampp control panel v. 3.2.1 with administrator rights on Windows 7 Ultimate (64-bit).
After editing php.ini in the php folder in xampp to change upload_max_filesize, phpinfo() shows no change of default value i.e. 2M. Checked phpinfo() through xampp and by creating a test file also. Same value of 2M is displayed.
Searched all concerned forums, but same old solutions didn't solve the problem. Any help will be appreciated. Thanks.
Providing solution to help others having similar problems. Editing the original php.ini file in Notepad++ v. 6.8.3 didn't have any effect. Therefore, copied contents of the original php.ini file and pasted it to create a new php.ini file in Notepad++ itself. Changed the required values and saved. Bingo!
Like yourself, I tried all the available solutions with no success so I figured why not to delete the file and create a new one from scratch. And voila it worked.
I use Visual Code Studio but it should work with other file editors.

Installing PHP on Linux and php.ini file

I have installed PHP with Apache 2.2 on my Linux machine and all works fine following guide here
During the installation I had to copy the php.ini-development file into /usr/local/lib/php.ini, the question is why? Why exactly in this directory?
Default locations of the PHP configurations vary greatly by distribution. In any case, phpinfo() will allways tell you where is looks for your configurations.
So, create file with extension ".php" in your webroot and past this into it:
<?php
phpinfo();
Also, the default php.ini files contain plenty od usefull comments. Just read them and change what you need. Differences between dev and prod environments are usually only the verbosity. They show and log different ammounts of errors. Production usually shows no error at all.
(Debian and many other distributions put the PHP config into /etc/php5. This is actually the most reasonable place for configurations, but stick with what your distribution uses.)
The document you link to says this
You may edit your .ini file to set PHP options. [...]
If you instead choose php.ini-production, be certain to read the list of changes within, as they affect how PHP behaves.`
Have you tried something like
vi /usr/local/lib/php.ini
to see what's in it?
Maybe you need to read http://www.php.net/manual/en/configuration.file.php
You copied a default PHP.ini file, php.ini-development, to the standard 'php.ini' file in the location '/usr/local/lib/' the guide http://www.php.net/manual/it/install.unix.apache2.php
expected the php.ini file to be.
The php.ini file is a configuration file used by PHP when it is launched (runtime)

XAMPP and cURL not working, after uncommenting php.ini

Someone else with the same problem still didn't get a decent answer/fix for my problem:
Before you comment or criticize, please make sure you read my proceedures below so as not to repeat what I've seen 100x already in Google and Stack Overflow...
XAMPP (Lite) installed on Windows 7 in C:\xampplite (newest version, only one php.ini file in C:\xampplite\php)
XAMPP and PHP scripts run correctly in http://localhost/
libcurl installed (by XAMPP default) in C:\xampplite\php\ext\php_curl.dll
php.ini edited and saved for removal of ; at beginning of line extension=php_curl.dll
php.ini default for extension_dir = "C:\xampplite\php\ext" correct and left alone
Apache service restarted in Windows Services
Computer restarted
Apache service (manually) restarted again
phpinfo(); still does not display anything with the word "curl" in it
Still no success
Thanks in advance.
I had the exact same problem but could not find the solution online.
Every site I saw said to uncomment "extension=php_curl.dll" which didn't fix the problem.
I finally solved it by adding the path to curl.dll to the variable.
That is, I changed: extension=php_curl.dll
to:
extension="F:/WebServer/PHP/ext/php_curl.dll"
Hope this helps you or somebody else.
I had a similar problem except for error reporting. Searched all over the internet and all I found was "modify the php.ini file". I modified all the php.ini files but I was still getting the same error. Turns out WAMP has visual settings which I believe overwrite the php.ini. So to turn on curl, you'd left click on XAMPP icon in your start start menu -> PHP -> PHP Settings -> php_curl (make sure it is checked).
Maybe this is your problem.
Hope it helps.
-c0d3
Try executing curl
xampp/apache/bin/curl.exe
with admin privileges.
Restarting the PHP server will do.

PHP Sqlite Configuration in Windows Not Working

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

Categories