NuSphere Forums Forum Index
NuSphere Forums
Reply to topic
php.ini configuration file is not found


Joined: 03 Feb 2009
Posts: 1
Reply with quote
Hi-

I just got PHPEd the other day and so far it's great. However, when trying to create a new project using a local host, I get a problem when checking php installation. I can't successfully create the project.

The error is:

Error (-122) php.ini() configuration file is not found

I've done a phpinfo() and I'm a little confused. The path to the php.ini file is c:\windows. In there is a php.ini file there, so it should find it OK.

But, I also looked for the extension_dir folder in phpinfo() and it said c:\php5 In the php.ini file it says c:\php\ext\ So this is my confusion.

Is there some other location for the php.ini file it is looking for? I found another one in the NuSphere installation area, but obviously it isn't being found either. It does have the extensions directory set to a different location in the NuSphere area (one that seems more logical to me).

Any guidance on what I should do to make this work? Should I uninstall everything and start over (I've reinstalled PHPIde about 4 times now)?

Thanks...
View user's profileFind all posts by mjh1_2001Send private message
Site Admin

Joined: 13 Jul 2003
Posts: 7887
Reply with quote
Quote:
Is there some other location for the php.ini file it is looking for?


hmm, php.ini is just a configuration file, it does not look for anything. As of php itself, it searches for php.ini in the locations listed in the manual:
http://www.php.net/manual/en/configuration.file.php

Quote:
Any guidance on what I should do to make this work?


If it is php that you have installed yourself (for example as a part of 3rd party package), please follow the php manual and make sure php.ini with appropriate content is created in appropriate location.
If you're using php that came with NuSphere PhpED, please contact support and provide the details.

_________________
The PHP IDE team
View user's profileFind all posts by dmitriSend private messageVisit poster's website


Joined: 13 Feb 2009
Posts: 1
Reply with quote
Reinstall PHP,
I got that problem when installed VisualStudio. Studio changes some paths, so reinstall(rapair) PHP and enjoy !
View user's profileFind all posts by hovo148Send private message


Joined: 15 Jan 2017
Posts: 7
Reply with quote
hi,

just wanted to report that - with a freshly installed PHPEd 18 - the wizard cannot find php.ini either.
Tried setting HKEY_LOCAL_MACHINE\SOFTWARE\PHP\IniFilePath like stated in the PHP documentation you cited, but still it cannot find it.
I'll keep on trying (setting %PHPRC% and so on), but why doesn't the wizard let me point to the php.ini file myself?
View user's profileFind all posts by DrNOPSend private message
Site Admin

Joined: 13 Jul 2003
Posts: 7887
Reply with quote
HKEY_LOCAL_MACHINE\SOFTWARE\PHP\IniFilePath, %PHPRC% etc are not wise ideas. If you use them, you won't be able to have more than one php in your system. It means that if you try php package installed with phped (as well as any other), you'll get only troubles.
If you're going to use xamp, make sure php.ini is in apache binary directory. Php will find it there and reflect this fact in phpinfo() output, so the wizard will find it easily.
Alternatively, you can store php.ini in for example %APPDATA%\PHP directory, and specify full (real) path in httpd.conf like below:
PHPIniDir "C:/Users/MyName/AppData/Roaming/PHP"

_________________
The PHP IDE team
View user's profileFind all posts by dmitriSend private messageVisit poster's website


Joined: 15 Jan 2017
Posts: 7
Reply with quote
dmitri wrote:
Alternatively, you can store php.ini in for example %APPDATA%\PHP directory, and specify full (real) path in httpd.conf like below:
PHPIniDir "C:/Users/MyName/AppData/Roaming/PHP"


thanks - I'll use that option

{later}
Xampp/Apache won't start with that option.
Without it, phpinfo() states it uses php.ini from that very same folder.
But this seems to be an XAMPP problem. I'll leave it for now - although I like to have things under my control. Confused
View user's profileFind all posts by DrNOPSend private message
Site Admin

Joined: 13 Jul 2003
Posts: 7887
Reply with quote
Quote:
Xampp/Apache won't start with that option.

You need to check apache logs then. Most likely you have problem with syntax or something like that. Also make sure that php.ini is correct. It's very easy to screw php.ini up by for example making extension_dir pointing to a directory with a different php version.

_________________
The PHP IDE team
View user's profileFind all posts by dmitriSend private messageVisit poster's website


Joined: 15 Jan 2017
Posts: 7
Reply with quote
dmitri wrote:
Quote:
Xampp/Apache won't start with that option.

You need to check apache logs then. Most likely you have problem with syntax or something like that. Also make sure that php.ini is correct.

httpd.exe won't even show up in task manager, so nothing gets logged in error.log.
Tried various solutions like (cannot post URLs here)
Also replaced php.ini with one containing only "[PHP]"

As soon as I comment out the PHPIniDir line - everything ok.
Code:
PHPIniDir "D:\Temp\xampp56\php"

 Verzeichnis von D:\Temp\xampp56\php
21.01.2017  13:44            75.173 php.ini

I think it's not a PHPEd problem, but XAMPP

Quote:
It's very easy to screw php.ini up by for example making extension_dir pointing to a directory with a different php version.


BTW: after installation, PHPEd's wizard placed the "zend_extension=" line randomly in the php.ini.
At first, it was above [PHP]. Then it was between [openssl] and [debugger]
I had to move it to the [PHP] section manually.

Also, apache's error.log said: "dbg-php-5.6.dll: invalid Win32 application". (it was from NuSphere according to properties|details)
I replaced it with a version 8.2.7.8207 (from a newer install, IIRC); now it works.
View user's profileFind all posts by DrNOPSend private message
Site Admin

Joined: 13 Jul 2003
Posts: 7887
Reply with quote
-Sections in php.ini are ignored by php. So it does not matter where zend_extension is placed. Normally it is added before [debugger] section. But if you don't have one it may appear at the top.
-Even though httpd.exe does not appear in the task manager, it does not mean it did not try to start. Since it's the only exe that reads httpd.conf and the problem is definitely in this file, httpd.exe was really started. Normally it logs errors in error_log. If it didn't, you have to contact xampp maintainers and ask them how they managed to screw httpd.exe up.

anyway, make sure that you have all the following lines in your httpd.conf:

AddType application/x-httpd-php .php
LoadFile "C:/path/to/php5ts.dll/in/xampp/directory/tree/including/php5ts.dll/itself"
LoadModule php5_module "C:/path/to/php5apache2.dll/in/xampp/directory/tree/including/php5apache2.dll/itself"
PHPIniDir "C:/correct/path/to/php.ini/in/XAMPP/directory/tree/including/php.ini/itself"

_________________
The PHP IDE team
View user's profileFind all posts by dmitriSend private messageVisit poster's website


Joined: 15 Jan 2017
Posts: 7
Reply with quote
dmitri wrote:

AddType application/x-httpd-php .php
LoadFile "C:/path/to/php5ts.dll/in/xampp/directory/tree/including/php5ts.dll/itself"
LoadModule php5_module "C:/path/to/php5apache2.dll/in/xampp/directory/tree/including/php5apache2.dll/itself"
PHPIniDir "C:/correct/path/to/php.ini/in/XAMPP/directory/tree/including/php.ini/itself"


thanks, but that didn't change the behavior (freezes as soon as PHPIniDir is set)
The php5_module line throws the error
AH01574: module php5_module is already loaded, skipping

Quote:
you have to contact xampp maintainers and ask them how they managed to screw httpd.exe up.

I guess so Confused
View user's profileFind all posts by DrNOPSend private message
Site Admin

Joined: 13 Jul 2003
Posts: 7887
Reply with quote
Quote:
AH01574: module php5_module is already loaded, skipping

It sounds quite clear - the module is already loaded elsewhere and you have to find where.
when you find it, check if phpinidir setting is there too.

_________________
The PHP IDE team
View user's profileFind all posts by dmitriSend private messageVisit poster's website


Joined: 15 Jan 2017
Posts: 7
Reply with quote
dmitri wrote:
It sounds quite clear - the module is already loaded elsewhere and you have to find where.


you're right Smile

excerpt from httpd-xampp.conf (whatever this file is good for; I'll find that out)
(I replaced my php dir with $(PHPDIR))

Code:

#
# PHP-Module setup
#
LoadFile "$(PHPDIR)/php5ts.dll"
LoadFile "$(PHPDIR)/libpq.dll"
LoadModule php5_module "$(PHPDIR)/php5apache2_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 php5_module>
    PHPINIDir "$(PHPDIR)"
</IfModule>


Riddle solved Cool
View user's profileFind all posts by DrNOPSend private message
php.ini configuration file is not found
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
All times are GMT - 5 Hours  
Page 1 of 1  

  
  
 Reply to topic