cancel
Showing results for 
Search instead for 
Did you mean: 

bin/magento problems

SOLVED

bin/magento problems

giving a bin / magento this error happens:

 

PHP Fatal error: Uncaught Error: Class 'DOMDocument' not found in /opt/lampp/htdocs/code/slv/vendor/magento/framework/Config/Dom.php:449

Stack trace:

# 0 /opt/lampp/htdocs/code/slv/vendor/magento/framework/Config/Dom.php(116): Magento \ Framework \ Config \ Dom -> _ initDom ('<? Xml version = "...' )

# 1 /opt/lampp/htdocs/code/slv/vendor/magento/framework/ObjectManager/Config/Reader/Dom.php(70): Magento \ Framework \ Config \ Dom -> __ construct ('<? Xml version = " ... ', Object (Magento \ Framework \ App \ Arguments \ ValidationState), Array,' xsi: type ', NULL)

# 2 /opt/lampp/htdocs/code/slv/vendor/magento/framework/Config/Reader/Filesystem.php(151): Magento \ Framework \ ObjectManager \ Config \ Reader \ Dom -> _ createConfigMerger ('Magento \\ Framewo ... ',' <? xml version = "... ')

# 3 /opt/lampp/htdocs/code/slv/vendor/magento/framework/Config/Reader/Filesystem.php(132): Magento \ Framework \ Config \ Reader \ Filesystem -> _ readFiles (Object (Magento \ Framework \ Config \ FileIterator))

# 4 /opt/lampp/htdocs/code/slv/vendor/magento/framework/App/ObjectManagerFactory.php(279): Magento \ Framework \ Config in / opt / lampp / htdocs / code / slv / vendor / magento / framework /Config/Dom.php on line 449

 

php version 7.2 (via xampp), folder ta without permission restrictions.

 

can you tell me why this occurs ???

2 ACCEPTED SOLUTIONS

Accepted Solutions

Re: bin/magento problems


@Sunil Patel wrote:

Hello @artur01via91aa 

 

You can rename any name


I restored the virtual machine where the magento ran and is now giving another error:

 

pac@pac-VirtualBox:/opt/lampp/htdocs/code/slv$ ls
app bin composer.json COPYING.txt generated Gruntfile.js.sample lib LICENSE.txt package.json.sample pub SECURITY.md SLV.mwb update vendor
auth.json.sample CHANGELOG.md composer.lock dev grunt-config.json.sample index.php LICENSE_AFL.txt nginx.conf.sample phpserver README.md setup SLV.mwb.bak var


pac@pac-VirtualBox:/opt/lampp/htdocs/code/slv$ bin/magento
/usr/bin/env: ‘php’: No such file or directory


pac@pac-VirtualBox:/opt/lampp/htdocs/code/slv$

 

but it is working via bowser am i using xampp to run magento and is it ideal for that?

View solution in original post

Re: bin/magento problems

I was using xampp I moved to the separate apache, php, mysql and phpmyadmin modules and I had no more problems

View solution in original post

13 REPLIES 13

Re: bin/magento problems

Hi @artur01via91aa 

Please install the php-dom and php-xml packages, however it looks like from you PHP info. that you have done so. If you are on Debian or Ubuntu you can make sure by running 

 

apt install php-dom php-xml

You likely need to restart PHP FPM or Apache for the changes to take effect - eg. 

systemctl restart php-fpm
Or
systemctl restart apache2 (or systemctl restart httpd)

If issue resolve, please click on 'Kudos' & Accept as Solution!

 

Problem solved? Click Accept as Solution!

Re: bin/magento problems

Hello @artur01via91aa 

 

seems like 

php-xml 
php-dom

 above extension missing from php

 

sudo apt-get install php-dom

please install using above command and check it


if works then mark as solution


Problem solved? Click Kudos & Accept as Solution!
Sunil Patel
Magento 2 Certified Professional Developer & Frontend Developer

Re: bin/magento problems

now it's giving another error:

 

PHP Fatal error: Uncaught Error: Undefined class constant 'PDO::MYSQL_ATTR_SSL_KEY' in /opt/lampp/htdocs/code/slv/setup/src/Magento/Setup/Model/ConfigOptionsList.php:179
Stack trace:
#0 /opt/lampp/htdocs/code/slv/setup/src/Magento/Setup/Model/ConfigModel.php(71): Magento\Setup\Model\ConfigOptionsList->getOptions()
#1 /opt/lampp/htdocs/code/slv/setup/src/Magento/Setup/Console/Command/ConfigSetCommand.php(64): Magento\Setup\Model\ConfigModel->getAvailableOptions()
#2 /opt/lampp/htdocs/code/slv/vendor/symfony/console/Command/Command.php(77): Magento\Setup\Console\Command\ConfigSetCommand->configure()
#3 /opt/lampp/htdocs/code/slv/setup/src/Magento/Setup/Console/Command/ConfigSetCommand.php(54): Symfony\Component\Console\Command\Command->__construct()
#4 /opt/lampp/htdocs/code/slv/vendor/zendframework/zend-di/src/Di.php(512): Magento\Setup\Console\Command\ConfigSetCommand->__construct(Object(Magento\Setup\Model\ConfigModel), Object(Magento\Framework\Module\ModuleList), Object(Magento\Framework\App\DeploymentConfig))
#5 /opt/lampp in /opt/lampp/htdocs/code/slv/setup/src/Magento/Setup/Model/ConfigOptionsList.php on line 179

Re: bin/magento problems


@Bhanu Periwal wrote:

Hi @artur01via91aa 

Please install the php-dom and php-xml packages, however it looks like from you PHP info. that you have done so. If you are on Debian or Ubuntu you can make sure by running 

 

apt install php-dom php-xml

You likely need to restart PHP FPM or Apache for the changes to take effect - eg. 

systemctl restart php-fpm
Or
systemctl restart apache2 (or systemctl restart httpd)

If issue resolve, please click on 'Kudos' & Accept as Solution!

 


I did what you said, but now this is giving another error:

 

PHP Fatal error: Uncaught Error: Undefined class constant 'PDO::MYSQL_ATTR_SSL_KEY' in /opt/lampp/htdocs/code/slv/setup/src/Magento/Setup/Model/ConfigOptionsList.php:179
Stack trace:
#0 /opt/lampp/htdocs/code/slv/setup/src/Magento/Setup/Model/ConfigModel.php(71): Magento\Setup\Model\ConfigOptionsList->getOptions()
#1 /opt/lampp/htdocs/code/slv/setup/src/Magento/Setup/Console/Command/ConfigSetCommand.php(64): Magento\Setup\Model\ConfigModel->getAvailableOptions()
#2 /opt/lampp/htdocs/code/slv/vendor/symfony/console/Command/Command.php(77): Magento\Setup\Console\Command\ConfigSetCommand->configure()
#3 /opt/lampp/htdocs/code/slv/setup/src/Magento/Setup/Console/Command/ConfigSetCommand.php(54): Symfony\Component\Console\Command\Command->__construct()
#4 /opt/lampp/htdocs/code/slv/vendor/zendframework/zend-di/src/Di.php(512): Magento\Setup\Console\Command\ConfigSetCommand->__construct(Object(Magento\Setup\Model\ConfigModel), Object(Magento\Framework\Module\ModuleList), Object(Magento\Framework\App\DeploymentConfig))
#5 /opt/lampp in /opt/lampp/htdocs/code/slv/setup/src/Magento/Setup/Model/ConfigOptionsList.php on line 179

Re: bin/magento problems

Hello @artur01via91aa 

 

seems like lot of php extension missing

 

try one thing

rename app/etc/env.php and app/etc/config.php so it will rediect to setup page and it will show you which php extension missing then enable one by one if all is ok. then revert back env.php and config.php 

 

Hope it will help you.

 

If help you then mark as solution


Problem solved? Click Kudos & Accept as Solution!
Sunil Patel
Magento 2 Certified Professional Developer & Frontend Developer

Re: bin/magento problems


@Sunil Patel wrote:

Hello @artur01via91aa 

 

seems like lot of php extension missing

 

try one thing

rename app/etc/env.php and app/etc/config.php so it will rediect to setup page and it will show you which php extension missing then enable one by one if all is ok. then revert back env.php and config.php 

 

Hope it will help you.

 

If help you then mark as solution


 

these are the modules enabled on my virtua machine

 

which ones should be enabled?

 

is there any package that has all the existing php modules for linux?

 

root@pac-VirtualBox:/opt/lampp/htdocs/code/slv# php -m
[PHP Modules]
calendar
Core
ctype
date
dom
exif
fileinfo
filter
ftp
gettext
hash
iconv
json
libxml
openssl
pcntl
pcre
PDO
Phar
posix
readline
Reflection
session
shmop
SimpleXML
sockets
sodium
SPL
standard
sysvmsg
sysvsem
sysvshm
tokenizer
wddx
xml
xmlreader
xmlwriter
xsl
Zend OPcache
zlib

 

[Zend Modules]
Zend OPcache

Re: bin/magento problems

Hello @artur01via91aa 

 

have you tried as i said

 

just try it it will give you list of extension missing into php

 


Problem solved? Click Kudos & Accept as Solution!
Sunil Patel
Magento 2 Certified Professional Developer & Frontend Developer

Re: bin/magento problems


@Sunil Patel wrote:

Hello @artur01via91aa 

 

have you tried as i said

 

just try it it will give you list of extension missing into php

 


rename exactly which line of files ???

 


root@pac-VirtualBox:/opt/lampp/htdocs/code/slv/app/etc# cat env.php
<?php
return [
'backend' => [
'frontName' => 'admin_9d8o8w'
],
'crypt' => [
'key' => 'b8e688f23cbed4369e3dc95faa01045f'
],
'db' => [
'table_prefix' => '',
'connection' => [
'default' => [
'host' => 'localhost',
'dbname' => 'slv',
'username' => 'root',
'password' => '',
'active' => '1',
'driver_options' => [

]
]
]
],
'resource' => [
'default_setup' => [
'connection' => 'default'
]
],
'x-frame-options' => 'SAMEORIGIN',
'MAGE_MODE' => 'default',
'session' => [
'save' => 'files'
],
'cache' => [
'frontend' => [
'default' => [
'id_prefix' => 'ab7_'
],
'page_cache' => [
'id_prefix' => 'ab7_'
]
]
],
'lock' => [
'provider' => 'db',
'config' => [
'prefix' => null
]
],
'cache_types' => [
'config' => 1,
'layout' => 1,
'block_html' => 1,
'collections' => 1,
'reflection' => 1,
'db_ddl' => 1,
'compiled_config' => 1,
'eav' => 1,
'customer_notification' => 1,
'config_integration' => 1,
'config_integration_api' => 1,
'google_product' => 1,
'full_page' => 1,
'config_webservice' => 1,
'translate' => 1,
'vertex' => 1
],
'downloadable_domains' => [
'192.168.100.55'
],
'install' => [
'date' => 'Sun, 12 Apr 2020 13:54:56 +0000'
]
];

Re: bin/magento problems

Hello @artur01via91aa 

 

rename whole file env.php and config.php

 


Problem solved? Click Kudos & Accept as Solution!
Sunil Patel
Magento 2 Certified Professional Developer & Frontend Developer