PHP ini file not loaded in XAMPP 7.4.16

Problems with the Windows version of XAMPP, questions, comments, and anything related.

PHP ini file not loaded in XAMPP 7.4.16

Postby ricardouel » 24. March 2021 19:23

Hello friends.

I have XAMPP 7.4.16 on my Windows 8 which came with PHP 7.4.16. I am not able to make the customization of the variables in the php.ini file because the impression I have is that he is not reading the file in the folder C:\xampp\php\ because everything I change there does not appear when I run <? Php echo php_info (); ?>. Does anyone have any idea what may be going on?

In my php_info() view the value of variable "Loaded Configuration File" is "(no value)".

Thanks.

Ricardo.
ricardouel
 
Posts: 14
Joined: 24. March 2021 19:11
XAMPP version: 7.4.16
Operating System: Windows 8

Re: PHP ini file not loaded in XAMPP 7.4.16

Postby gsmith » 24. March 2021 21:41

Did you restart Apache after making your changes to php.ini?
gsmith
 
Posts: 278
Joined: 29. November 2013 18:04
Location: San Diego
XAMPP version: 0.0.0
Operating System: Win 10/2012R VS 14,15,16

Re: PHP ini file not loaded in XAMPP 7.4.16

Postby ricardouel » 24. March 2021 21:52

Yes. Always after make changes.
ricardouel
 
Posts: 14
Joined: 24. March 2021 19:11
XAMPP version: 7.4.16
Operating System: Windows 8

Re: PHP ini file not loaded in XAMPP 7.4.16

Postby Altrea » 25. March 2021 00:30

Hi,

What is the conents of your \xampp\apache\conf\extra\httpd-xampp.conf ?
We don't provide any support via personal channels like PM, email, Skype, TeamViewer!

It's like porn for programmers 8)
User avatar
Altrea
AF Moderator
 
Posts: 11935
Joined: 17. August 2009 13:05
XAMPP version: several
Operating System: Windows 11 Pro x64

Re: PHP ini file not loaded in XAMPP 7.4.16

Postby ricardouel » 25. March 2021 14:13

Altrea wrote:Hi,

What is the conents of your \xampp\apache\conf\extra\httpd-xampp.conf ?


Hi.

See bellow. I use several versions of PHP in my xampp with virtual hosts for different ports.

Ricardo.

#
# XAMPP settings
#

<IfModule env_module>
SetEnv MIBDIRS "C:/xampp/php/extras/mibs"
SetEnv MYSQL_HOME "\\xampp\\mysql\\bin"
SetEnv OPENSSL_CONF "C:/xampp/apache/bin/openssl.cnf"
SetEnv PHP_PEAR_SYSCONF_DIR "\\xampp\\php"
# SetEnv PHP_PEAR_SYSCONF_DIR "C:/xampp/php"
SetEnv PHPRC "\\xampp\\php"
# SetEnv PHPRC "C:/xampp/php"
SetEnv TMP "\\xampp\\tmp"
# SetEnv TMP "C:/xampp/tmp"
</IfModule>

#
# PHP-Module setup
#
#LoadFile "C:/xampp/php/php7ts.dll"
#LoadFile "C:/xampp/php/libpq.dll"
#LoadFile "C:/xampp/php/libsqlite3.dll"
#LoadModule php7_module "C:/xampp/php/php7apache2_4.dll"

<FilesMatch "\.php$">
SetHandler application/x-httpd-php
</FilesMatch>
<FilesMatch "\.phps$">
SetHandler application/x-httpd-php-source
</FilesMatch>

#
# PHP-CGI setup
#
#<FilesMatch "\.php$">
# SetHandler application/x-httpd-php-cgi
#</FilesMatch>
#<IfModule actions_module>
# Action application/x-httpd-php-cgi "/php-cgi/php-cgi.exe"
#</IfModule>


<IfModule php7_module>
PHPINIDir "C:/xampp/php"
</IfModule>

<IfModule mime_module>
AddType text/html .php .phps
</IfModule>

ScriptAlias /php-cgi/ "C:/xampp/php/"
<Directory "C:/xampp/php">
AllowOverride None
Options None
Require all denied
<Files "php-cgi.exe">
Require all granted
</Files>
</Directory>

<Directory "C:/xampp/cgi-bin">
<FilesMatch "\.php$">
SetHandler cgi-script
</FilesMatch>
<FilesMatch "\.phps$">
SetHandler None
</FilesMatch>
</Directory>

<Directory "C:/xampp/htdocs/xampp">
<IfModule php7_module>
<Files "status.php">
php_admin_flag safe_mode off
</Files>
</IfModule>
AllowOverride AuthConfig
</Directory>

<IfModule alias_module>
Alias /licenses "C:/xampp/licenses/"
<Directory "C:/xampp/licenses">
Options +Indexes
<IfModule autoindex_color_module>
DirectoryIndexTextColor "#000000"
DirectoryIndexBGColor "#f8e8a0"
DirectoryIndexLinkColor "#bb3902"
DirectoryIndexVLinkColor "#bb3902"
DirectoryIndexALinkColor "#bb3902"
</IfModule>
Require local
ErrorDocument 403 /error/XAMPP_FORBIDDEN.html.var
</Directory>

Alias /phpmyadmin "C:/xampp/phpMyAdmin/"
<Directory "C:/xampp/phpMyAdmin">
AllowOverride AuthConfig
Require local
ErrorDocument 403 /error/XAMPP_FORBIDDEN.html.var
</Directory>

Alias /webalizer "C:/xampp/webalizer/"
<Directory "C:/xampp/webalizer">
<IfModule php7_module>
<Files "webalizer.php">
php_admin_flag safe_mode off
</Files>
</IfModule>
AllowOverride AuthConfig
Require local
ErrorDocument 403 /error/XAMPP_FORBIDDEN.html.var
</Directory>
</IfModule>

##
#Hosts virtuais para execução de várias versões de PHP em portas diferentes
##

##
#PHP 7.3 na porta 8083
##
ScriptAlias /php_7.3 "C:/xampp/php_7.3"
<Directory "C:/xampp/php_7.3">
AllowOverride None
Options None
Require all denied
<Files "php-cgi.exe">
Require all granted
</Files>
</Directory>

Listen 8083
<VirtualHost *:8083>
LoadFile "C:/xampp/php/php7ts.dll"
LoadFile "C:/xampp/php/libpq.dll"
LoadFile "C:/xampp/php/libsqlite3.dll"
LoadModule php7_module "C:/xampp/php/php7apache2_4.dll"
UnsetEnv PHPRC
<FilesMatch "\.php$">
php_flag engine off
SetHandler application/x-httpd-php
Action application/x-httpd-php "/php_7.3/php-cgi.exe"
</FilesMatch>
</VirtualHost>

##
#PHP 7.2 na porta 8082
##
ScriptAlias /php_7.2 "C:/xampp/php_7.2"
<Directory "C:/xampp/php_7.2">
AllowOverride None
Options None
Require all denied
<Files "php-cgi.exe">
Require all granted
</Files>
</Directory>

Listen 8082
<VirtualHost *:8082>
LoadFile "C:/xampp/php/php7ts.dll"
LoadFile "C:/xampp/php/libpq.dll"
LoadFile "C:/xampp/php/libsqlite3.dll"
LoadModule php7_module "C:/xampp/php/php7apache2_4.dll"
UnsetEnv PHPRC
<FilesMatch "\.php$">
php_flag engine off
SetHandler application/x-httpd-php
Action application/x-httpd-php "/php_7.2/php-cgi.exe"
</FilesMatch>
</VirtualHost>

##
#PHP 7.1 na porta 8081
##
ScriptAlias /php_7.1 "C:/xampp/php_7.1"
<Directory "C:/xampp/php_7.1">
AllowOverride None
Options None
Require all denied
<Files "php-cgi.exe">
Require all granted
</Files>
</Directory>

Listen 8081
<VirtualHost *:8081>
LoadFile "C:/xampp/php/php7ts.dll"
LoadFile "C:/xampp/php/libpq.dll"
LoadFile "C:/xampp/php/libsqlite3.dll"
LoadModule php7_module "C:/xampp/php/php7apache2_4.dll"
UnsetEnv PHPRC
<FilesMatch "\.php$">
php_flag engine off
SetHandler application/x-httpd-php
Action application/x-httpd-php "/php_7.1/php-cgi.exe"
</FilesMatch>
</VirtualHost>

##
#PHP 7.0 na porta 8080
##
ScriptAlias /php_7.0 "C:/xampp/php_7.0"
<Directory "C:/xampp/php_7.0">
AllowOverride None
Options None
Require all denied
<Files "php-cgi.exe">
Require all granted
</Files>
</Directory>

Listen 8080
<VirtualHost *:8080>
UnsetEnv PHPRC
LoadFile "C:/xampp/php/php7ts.dll"
LoadFile "C:/xampp/php/libpq.dll"
LoadFile "C:/xampp/php/libsqlite3.dll"
LoadModule php7_module "C:/xampp/php/php7apache2_4.dll"
<FilesMatch "\.php$">
php_flag engine off
SetHandler application/x-httpd-php
Action application/x-httpd-php "/php_7.0/php-cgi.exe"
</FilesMatch>
</VirtualHost>

##
#PHP 5.6 na porta 8079
##
ScriptAlias /php_5.6 "C:/xampp/php_5.6"
<Directory "C:/xampp/php_5.6">
AllowOverride None
Options None
Require all denied
<Files "php-cgi.exe">
Require all granted
</Files>
</Directory>

Listen 8079
<VirtualHost *:8079>
UnsetEnv PHPRC
#LoadFile "C:/xampp/php_5.6/php5.dll"
#LoadFile "C:/xampp/php_5.6/libpq.dll"
#LoadModule php5_module "C:/xampp/php_5.6/php5apache2_4.dll"
<FilesMatch "\.php$">
php_flag engine off
SetHandler application/x-httpd-php_5.6-cgi
Action application/x-httpd-php_5.6-cgi "/php_5.6/php-cgi.exe"
</FilesMatch>
</VirtualHost>
ricardouel
 
Posts: 14
Joined: 24. March 2021 19:11
XAMPP version: 7.4.16
Operating System: Windows 8

Re: PHP ini file not loaded in XAMPP 7.4.16

Postby Altrea » 25. March 2021 15:17

ricardouel wrote:See bellow. I use several versions of PHP in my xampp with virtual hosts for different ports.

Didn't you thought this information could be relevant for your issue???

You unset PHPRC constant for your different PHP versions
Your PHPIniDir variable is only valid if running as php7 module
You commented out the entire PHP Apache Module setup

Where should PHP get its information where to find the configuration file?

Did you follow a tutorial or guide about how to configure multiple php versions in xampp or where did you get your information? Just wondering.
We don't provide any support via personal channels like PM, email, Skype, TeamViewer!

It's like porn for programmers 8)
User avatar
Altrea
AF Moderator
 
Posts: 11935
Joined: 17. August 2009 13:05
XAMPP version: several
Operating System: Windows 11 Pro x64

Re: PHP ini file not loaded in XAMPP 7.4.16

Postby Nobbie » 25. March 2021 15:39

Nobbie
 
Posts: 13183
Joined: 09. March 2008 13:04

Re: PHP ini file not loaded in XAMPP 7.4.16

Postby ricardouel » 25. March 2021 18:13

Altrea wrote:
ricardouel wrote:See bellow. I use several versions of PHP in my xampp with virtual hosts for different ports.

Didn't you thought this information could be relevant for your issue???

You unset PHPRC constant for your different PHP versions
Your PHPIniDir variable is only valid if running as php7 module

Where should PHP get its information where to find the configuration file?

Did you follow a tutorial or guide about how to configure multiple php versions in xampp or where did you get your information? Just wondering.


About your questions:

1) Yes it is extremely relevant but I am focusing on my problem which is PHP 7.4 that came in XAMPP and is in folder C:\xampp\php. Virtual hosts are OK for me now
2) Yes because I am following a tutorial and it already worked on another XAMPP installation with multiple PHPs
3) In PHP 7.4 that came with XAMPP it does not present the information about php.ini loaded. When I run <? php echo php_info (); ?> the variable "Loaded Configuration File" is "none"
4) Yes, I am using a tutorial that works perfectly. Remember that my problem is with PHP 7.4 defaults to XAMPP and not the other virtual hosts.

Ricardo.
ricardouel
 
Posts: 14
Joined: 24. March 2021 19:11
XAMPP version: 7.4.16
Operating System: Windows 8

Re: PHP ini file not loaded in XAMPP 7.4.16

Postby Altrea » 25. March 2021 18:46

ricardouel wrote:1) Yes it is extremely relevant but I am focusing on my problem which is PHP 7.4 that came in XAMPP and is in folder C:\xampp\php.
[...]
3) In PHP 7.4 that came with XAMPP it does not present the information about php.ini loaded. When I run <? php echo php_info (); ?> the variable "Loaded Configuration File" is "none"
4) [...] Remember that my problem is with PHP 7.4 defaults to XAMPP and not the other virtual hosts.

So?

Original XAMPP configuration
Code: Select all
#
# PHP-Module setup
#
LoadFile "C:/xampp/php/php7ts.dll"
LoadFile "C:/xampp/php/libpq.dll"
LoadFile "C:/xampp/php/libsqlite3.dll"
LoadModule php7_module "C:/xampp/php/php7apache2_4.dll"


Your configuration
Code: Select all
#
# PHP-Module setup
#
#LoadFile "C:/xampp/php/php7ts.dll"
#LoadFile "C:/xampp/php/libpq.dll"
#LoadFile "C:/xampp/php/libsqlite3.dll"
#LoadModule php7_module "C:/xampp/php/php7apache2_4.dll"


So where did you couple the original PHP 7.4.16 which comes with XAMPP with your Apache, if not in this lines as Apache module?
We don't provide any support via personal channels like PM, email, Skype, TeamViewer!

It's like porn for programmers 8)
User avatar
Altrea
AF Moderator
 
Posts: 11935
Joined: 17. August 2009 13:05
XAMPP version: several
Operating System: Windows 11 Pro x64

Re: PHP ini file not loaded in XAMPP 7.4.16

Postby ricardouel » 25. March 2021 19:05

Sorry my friend. These 4 lines containing the "loadfile" should be uncommented. In some attempts to understand what each line performed I commented and forgot to uncomment. Everything is working now.

Thanks.

Ricardo.
ricardouel
 
Posts: 14
Joined: 24. March 2021 19:11
XAMPP version: 7.4.16
Operating System: Windows 8

Re: PHP ini file not loaded in XAMPP 7.4.16

Postby Altrea » 25. March 2021 21:28

I'm happy to being able to help you out. Happy coding my friend 8)
We don't provide any support via personal channels like PM, email, Skype, TeamViewer!

It's like porn for programmers 8)
User avatar
Altrea
AF Moderator
 
Posts: 11935
Joined: 17. August 2009 13:05
XAMPP version: several
Operating System: Windows 11 Pro x64


Return to XAMPP for Windows

Who is online

Users browsing this forum: No registered users and 148 guests