Hướng dẫn php_xml dll extension download

I'm trying to install laravel-excel on my laravel project. That library requires below php extensions to be enabled.

  • PHP extension php_zip
  • PHP extension php_xml
  • PHP extension php_gd2
  • PHP extension php_iconv
  • PHP extension php_simplexml
  • PHP extension php_xmlreader
  • PHP extension php_zlib

I changed the php.ini accordingly. But I can't download related .dll files to copy to ext folder. Do you have any place to download these?

  • php
  • laravel
  • web
  • php-extension

asked Apr 9, 2021 at 8:34

Hướng dẫn php_xml dll extension download

7

  • what software you used for sever ? different software has there own location

    Apr 9, 2021 at 8:37

  • I just installed php in windows and using built in php server for serve laravel application

    Apr 9, 2021 at 8:41

  • you if you install php using built in php then you must know php location ?

    Apr 9, 2021 at 8:42

  • Yes i know the location. But php_xml does not come with default php installation. Where i can download them?

    Apr 9, 2021 at 8:49

  • Most of those extensions are built-in. You can't even disable them unless you recompile PHP from source. What is your PHP version and were did you get it from?

    Apr 9, 2021 at 9:22

1 Answer

answered Apr 10, 2021 at 0:22

I'm trying to install laravel-excel on my laravel project. That library requires below php extensions to be enabled.

Nội dung chính

  • Where to find an extension?
  • Which extension to download?
  • Loading an extension
  • Resolving problems
  • How do I enable PHP extensions in Windows?
  • How do I enable Simplexml extension in PHP ini?
  • How do I install PHP extensions?
  • How do I install PECL on Windows 10?

  • PHP extension php_zip
  • PHP extension php_xml
  • PHP extension php_gd2
  • PHP extension php_iconv
  • PHP extension php_simplexml
  • PHP extension php_xmlreader
  • PHP extension php_zlib

I changed the php.ini accordingly. But I can't download related .dll files to copy to ext folder. Do you have any place to download these?

  • php
  • laravel
  • web
  • php-extension

asked Apr 9, 2021 at 8:34

7

  • what software you used for sever ? different software has there own location

    Apr 9, 2021 at 8:37

  • I just installed php in windows and using built in php server for serve laravel application

    Apr 9, 2021 at 8:41

  • you if you install php using built in php then you must know php location ?

    Apr 9, 2021 at 8:42

  • Yes i know the location. But php_xml does not come with default php installation. Where i can download them?

    Apr 9, 2021 at 8:49

  • Most of those extensions are built-in. You can't even disable them unless you recompile PHP from source. What is your PHP version and were did you get it from?

    Apr 9, 2021 at 9:22

1 Answer

answered Apr 10, 2021 at 0:22

On Windows, you have two ways to load a PHP extension: either compile it into PHP, or load the DLL. Loading a pre-compiled extension is the easiest and preferred way.

To load an extension, you need to have it available as a ".dll" file on your system. All the extensions are automatically and periodically compiled by the PHP Group (see next section for the download).

To compile an extension into PHP, please refer to building from source documentation.

To compile a standalone extension (aka a DLL file), please refer to building from source documentation. If the DLL file is available neither with your PHP distribution nor in PECL, you may have to compile it before you can start using the extension.

Where to find an extension?

PHP extensions are usually called "php_*.dll" (where the star represents the name of the extension) and they are located under the "PHP\ext" folder.

PHP ships with the extensions most useful to the majority of developers. They are called "core" extensions.

However, if you need functionality not provided by any core extension, you may still be able to find one in » PECL. The PHP Extension Community Library (PECL) is a repository for PHP Extensions, providing a directory of all known extensions and hosting facilities for downloading and development of PHP extensions.

If you have developed an extension for your own uses, you might want to think about hosting it on PECL so that others with the same needs can benefit from your time. A nice side effect is that you give them a good chance to give you feedback, (hopefully) thanks, bug reports and even fixes/patches. Before you submit your extension for hosting on PECL, please read » PECL submit.

Which extension to download?

Many times, you will find several versions of each DLL:

  • Different version numbers (at least the first two numbers should match)
  • Different thread safety settings
  • Different processor architecture (x86, x64, ...)
  • Different debugging settings
  • etc.

You should keep in mind that your extension settings should match all the settings of the PHP executable you are using. The following PHP script will tell you all about your PHP settings:

Or from the command line, run:

drive:\\path\to\php\executable\php.exe -i

Loading an extension

The most common way to load a PHP extension is to include it in your php.ini configuration file. Please note that many extensions are already present in your php.ini and that you only need to remove the semicolon to activate them.

Note that, on PHP version 7.2.0 and up, the extension name may be used instead of the extension's file name. As this is OS-independent and easier, especially for newcomers, it becomes the recommended way of specifying extensions to load. File names remain supported for compatibility with prior versions.

;extension=php_extname.dll
extension=php_extname.dll
; On PHP version 7.2 and up, prefer :
extension=extname
zend_extension=another_extension

However, some web servers are confusing because they do not use the php.ini located alongside your PHP executable. To find out where your actual php.ini resides, look for its path in phpinfo():

Configuration File (php.ini) Path  C:\WINDOWS
Loaded Configuration File   C:\Program Files\PHP\5.2\php.ini

After activating an extension, save php.ini, restart the web server and check phpinfo() again. The new extension should now have its own section.

Resolving problems

If the extension does not appear in phpinfo(), you should check your logs to learn where the problem comes from.

If you are using PHP from the command line (CLI), the extension loading error can be read directly on screen.

If you are using PHP with a web server, the location and format of the logs vary depending on your software. Please read your web server documentation to locate the logs, as it does not have anything to do with PHP itself.

Common problems are the location of the DLL and the DLLs it depends on, the value of the " extension_dir" setting inside php.ini and compile-time setting mismatches.

If the problem lies in a compile-time setting mismatch, you probably didn't download the right DLL. Try downloading again the extension with the right settings. Again, phpinfo() can be of great help.

ferdnyc at gmail dot com

17 days ago

This is handwaved somewhat in the "Resolving problems" section, but mis-location of (non-extension) DLL files is often a problem when installing PHP extensions on Windows.

Many PHP extensions come with not only the extension DLL, but supplementary DLLs that are required by that extension. (For example, php_luasandbox.dll comes with lua5.1.dll, the lua interpreter it sandboxes.) Those other DLLs should go into the same directory as the php.exe binary, NOT the extension directory.

So, if php_luasandbox.dll is installed at C:\PHP8.1\ext\php_luasandbox.dll, the interpreter would be located at C:\PHP8.1\lua5.1.dll. That allows the PHP binary C:\PHP8.1\php.exe to find those additional DLLs when required.

How do I enable PHP extensions in Windows?

On Windows, you have two ways to load a PHP extension: either compile it into PHP, or load the DLL. Loading a pre-compiled extension is the easiest and preferred way. To load an extension, you need to have it available as a ". dll" file on your system.

How do I enable Simplexml extension in PHP ini?

get your php version. php --version..

Instal package for your php version. sudo apt-get install php7.4-xml..

Restart apache. sudo systemctl reload apache2..

How do I install PHP extensions?

How To Compile And Install PHP Extensions From Source.

Install the PHP development package. On Ubuntu/debian, you can use apt-get, it's a piece of cake. ... .

Download & unzip the PHP5 source code. ... .

Prepare the extension (phpize) ... .

Configure & Make the extension. ... .

Move the extension. ... .

Edit your PHP. ... .

Restart your php..

How do I install PECL on Windows 10?

Here, we will install PECL on Windows by initially installing PEAR, a package repository for PHP. The initial step to installing PECL is to install PEAR. PEAR, as mentioned before, is a package repository for PHP. To begin installing PEAR, you are required to have PHP installed on your system.