开发者

How to enable xmlwriter after PHP having been compiled?

I've got a message that ext/xmlwriter is missing while trying to set up phpMyFAQ on my system of Fedora 15. I looked it up on the PHP manual and got this:

This extension is enabled by default. It may be disabled by using the following option at compile time: --disable-xmlwriter

I used yum to install PHP on my computer and consider recompiling PHP quite an unpleasant work. Can I j开发者_如何学编程ust enable it by editing something, like php.ini? Or any other ways to accomplish this task without recompiling PHP? And how?


on Ubuntu as root

apt install php-xmlwriter

worked for me

else

sudo apt install php-xmlwriter


In the context of modern PHP, since PHP 7, works the following library to solve this problem - php7.3-xml as an example for PHP 7.3. Works also for another version, change only for your PHP version.

Install for Ubuntu system is like: sudo apt-get install php7.3-xml

If you will install without the version knowledge, install it via sudo apt-get install php-xml.


Running the following as recommended by netcoder worked for me

yum install php-xmlwriter


I had same problem while moving to new server:

1) Check that libxml installed:

php -i | grep "xml"


Result example:

1   /etc/php.d/xmlreader.ini,
2   /etc/php.d/xmlwriter.ini,
3   xmlrpc_error_number => 0 => 0
4   xmlrpc_errors => Off => Off
5   libxml
6   mbstring.http_output_conv_mimetypes => ^(text/|applicatio...
7   Simplexml support => enabled
8   xml
9   libxml2 Version => 2.7.6
10  xmlwriter

Lines 5, 9 & 10 told us that all ok.

2) If not installed (example for CentOS):

yum install libxml2

and restart server:

/etc/apache2 restart

or php-fpm:

/etc/php-fpm restart

maybe will useful next variants:

yum install php-xmlwriter
yum install php-xml

For php from sources in latest versions xmlwriter enabled by default, but you can check, that key --disable-xmlwriter not set.

3) Last step - file:

/etc/php.d/xmlwriter.ini

Needing to be look like:

; Enable xmlwriter extension module
extension=xmlwriter.so

I think latest string - it's main decition for the problem.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜