Yarin
Yarin

Reputation: 183559

How to enable core PHP extension in Linux?

I'm trying to understand the process for enabling an a core extension (dom) in php. When I run phpinfo, I see '--disable-dom' in the configure command. Am I supposed to re-install PHP?

Upvotes: 1

Views: 3492

Answers (4)

teknopaul
teknopaul

Reputation: 6772

For Debian based systems

apt-get install php7.4-xml

Upvotes: 0

Shailendra Sharma
Shailendra Sharma

Reputation: 26

Use this command to install the dom extension.

yum install php-dom

and wait for the success message. After which reboot your Amazon instance, which would solve the problem.

Upvotes: 0

Rwky
Rwky

Reputation: 2144

You might be able to install it from your distributions repository. If not download your php versions source, extract it from the tarball. cd to the directory php/ext and look for a dom folder, cd into that and type phpize then make && make install that will install a dynamic extension for you which you can enable via extension=.so in your php.ini

Upvotes: 1

Mitch Dempsey
Mitch Dempsey

Reputation: 39889

Yes, you need to recompile PHP. Rerun ./configure with the appropriate parameter (probably --enable-dom, but I'm not sure on the param)

Upvotes: 1

Related Questions