Wamp 3.3.0 ignores php.ini?
Posted by: MegaCoder (77.137.66.---)
Date: July 25, 2023 04:22PM

After I installed wamp 3.3.0 xdebuger stopped working for me in VScode. After investigating the problem, I noticed that Apache uses PHP settings, which are found in, for example, the Wamp\bin\php\php8.2.0\phpForApache.ini file like:

xdebug.mode=debug
xdebug.start_with_request=yes

However, the settings I put in Wamp\bin\php\php8.2.0\php.ini are ignored, including important settings for xdebug.
After I manually entered the necessary settings in phpForApache.ini, xdebuger started working again.
This did not happen in previous versions.

I installed PHP 5.6 from wamp addons site. When I switch to this version of PHP in wamp, this problem does not happen and all the necessary settings from php.ini are present in phpForApache.ini of php 5.6 version.

What's wrong with wamp 3.3.0?

Options: ReplyQuote
Re: Wamp 3.3.0 ignores php.ini?
Posted by: Otomatic (Moderator)
Date: July 25, 2023 04:57PM

Nothing is wrong !

Since the dawn of time, for Wampserver, when PHP is used as an Apache module, the phpForApache.ini file is used, and when PHP is used by a command-line "trick", php.ini is used, as well as for FCGI mode.

And, what is "VScode", it's a "thing" that uses the command line.

---------------------------------------------------------------
Documentation Apache - Documentation PHP - Documentation MySQL - Wampserver install files & addons

Options: ReplyQuote
Re: Wamp 3.3.0 ignores php.ini?
Posted by: MegaCoder (77.137.66.---)
Date: July 25, 2023 05:29PM

Otomatic, you didn't understand. The problem is that phpForApache.ini stays un-updated after php,ini changed and wamp was restarted. Once again, I installed php 5.6 from addons site of wamp and this is not happens. I click on wamp icon in the system tray, choosing php.ini of 5.6, make changes, restart wamp and these changes appears in the phpForApache.ini of php5.6 folder. Any other php versions don't do that.

On my second PC i installed wamp about 6 months ago (the version 3.1 something) and every change of any php version after restart wamp services appears in phpForApache.ini of those php versions.
This is the issue... And it's look like bug or something..

Options: ReplyQuote
Re: Wamp 3.3.0 ignores php.ini?
Posted by: Otomatic (Moderator)
Date: July 26, 2023 10:29AM

Hi,

We need to clarify the situation and make sure we're talking about the same things.
- PHP configuration files
There are two PHP configuration FILES, regardless of version:
Example for PHP 7.4.33
-- php.ini file
e:\wamp64\bin\php\php7.4.33\php.ini
used to configure PHP in CLI or FCGI mode.

-- phpForApache.ini file
e:\wamp64\bin\p\php7.4.33\phpForApache.ini
used to configure PHP as an Apache module.

Since the creation of Wampserver, these two files have had different contents, and there is no interaction between them.
A modification to php.ini has never been reflected in phpForApache.ini, just as a modification to phpForApache.ini has never been reflected in php.ini.

Since Wampserver 3.2.8 (March 10, 2022) and support for the Apache FCGI module, i.e. since PHP 7.4.29, 8.0.17 and 8.1.4, the two files php.ini and phpForApache.ini are identical down to the headers:
- php.ini file header
; **************************************************************
; *** PHP 7.4.33 - php.ini file used for FCGI or CLI **********
; *** DO NOT EDIT THIS FILE for PHP used as an Apache module ***
; *** EDIT Wampmanager Icon -> PHP-> php.ini [apache module] ***
; *** that is wamp(64)/bin/apache/apache2.4.x/bin/php.ini ***
; **************************************************************
; * EDIT THIS FILE for PHP CLI or FCGI used with fcgid_module *
;***************************************************************

- phpForApache.ini header
; **************************************************************
; * PHP 7.4.33 - phpForApache.ini file used as Apache module **
; ** DO NOT EDIT THIS FILE for PHP CLI or FCGI (fcgid_module) **
; ** EDIT Wampmanager Icon -> PHP-> php.ini [CLI -- FCGI] **
; ********** that is wamp(64)/bin/php/phpx.y.z/php.ini *********
; **************************************************************
; ****** EDIT THIS FILE for PHP used as an Apache module *******
; **************************************************************

> The problem is that phpForApache.ini stays un-updated after php.ini changed
This is where you need to be very clear about what you're talking about!
- 1 - Is it the php.ini FILE?
- 2 - Is it the Left-Click -> PHP -> php.ini [Apache module] link?
- 3 - Is it the Left-Click -> PHP -> php.ini [CLI - FCGI] link?

In cases 1 and 3, this will be the php.ini FILE and there will be no repercussions in the phpForApache.ini file of modifications made in the php.ini file.

In case 2, the link is to e:\wamp64\bin\apacheapache2.4.57.3\bin\php.ini, which is not a file but a symbolic link.
If, while in e:\wamp64\bin\apacheapache2.4.57.3\bin\ we perform a dir php.ini, we obtain :
The volume in drive E is PC2D1_E
The volume's serial number is 50FB-B6C1
E:\wamp64\bin\apache2.4.57.3\bin directory
26/07/2023 09:09 <SYMLINK> php.ini [E:/wamp64/bin/php/php8.0.26/phpForApache.ini]

This means that if you click on Left-Click -> PHP -> php.ini [Apache module], Wampserver's default text editor will display php.ini as the name of the open file, but in the end, it's the phpForApache.ini file that will be modified, so you'd think that modifications to the php.ini file would be reflected in the phpForApache.ini file.

---------------------------------------------------------------
Documentation Apache - Documentation PHP - Documentation MySQL - Wampserver install files & addons

Options: ReplyQuote


Sorry, only registered users may post in this forum.