Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Adding Extensions to the php.ini file correctly

Status
Not open for further replies.

jdgti

Technical User
Jun 25, 2008
10
US
Hi All,

I hope I am in the right forum, I want to add libxml2 extension which will let PHP5 use SimpleXML functions.

I am using PHP 5.2.9-1 on Windows Server 2008. I have a successful installation of IIS 7, MySQL, and PHP with a few of the dynamic installations included in the php.msi file. So I have downloaded the LibXML2 package (libxml2-2.7.3.win32) and put the libxml2.dll file in the PHP5\ext folder as I specified in the php.ini file.

Then, as I understand it, I am supposed to open the .ini file and add the line "extension=libxml2.dll" in the extensions area. In my ini file this seems to be right at the end where other extensions are added like MySQL etc. They are listed in this way:

Code:
; Local Variables:
; tab-width: 4
; End:
[PHP_GD2]
extension=php_gd2.dll
[PHP_MBSTRING]
extension=php_mbstring.dll
[PHP_MCRYPT]
extension=php_mcrypt.dll
[PHP_MYSQL]
extension=php_mysql.dll

I just added this line:
Code:
[PHP_MYSQL]
extension=php_mysql.dll
[red]entension=libxml2.dll[/red]

The test I am using to see if it works is just opening the phpinfo.php file i have added to webroot.

Before I add this line the phpinfo file works fine, but when I add this line, the file fails with this error:

"HTTP Error 500.0 - Internal Server Error
C:\PHP5\php-cgi.exe - The FastCGI process exited unexpectedly"

I'm not sure why this happening. Can anyone give me some insight on this?

Thanks.

 
yup. that's how you add extensions. no magic at all.

but something is going wrong when php is instantiated. try putting libxml2 in c:\windows\system32 and see whether that works. if it does then it's a question of path variables (which we can help with, or you can live with the lib being in system32).
 
Code:
[PHP_MYSQL]
extension=php_mysql.dll
entension=libxml2.dll

You misspelled 'extension' here. Did you spell it correctly in the .ini file?

~Ben
"Insert witty statement here
 
Yea. I just checked it, and I did spell it correctly in the extension file. It still errors.

Another question, when i check my phpinfo site it says I already have a libxml2 instance enabled, however, I don't seen this in my PHP5\ext folder and there are no references to libxml2 in my .ini file.

Does PHP5 automatically come with a libxml2 integration without any need for references?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top