php bin/magento setup:upgrade gives error (localhost ubuntu 16.04) - dom

PHP bin/Magento module:status
I am making magneto simple custom module but give me below error.
user#user:/opt/lampp/htdocs/magento2$ php bin/magento module:status
PHP Fatal error: Uncaught Error: Class 'DOMDocument' not found in /opt/lampp/htdocs/magento2/vendor/magento/framework/Config/Dom.php:364
Stack trace:
#0 /opt/lampp/htdocs/magento2/vendor/magento/framework/Config/Dom.php(109): Magento\Framework\Config\Dom->_initDom('<?xml version="...')
#1 /opt/lampp/htdocs/magento2/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/magento2/vendor/magento/framework/Config/Reader/Filesystem.php(146): Magento\Framework\ObjectManager\Config\Reader\Dom->_createConfigMerger('Magento\\Framewo...', '<?xml version="...')
#3 /opt/lampp/htdocs/magento2/vendor/magento/framework/Config/Reader/Filesystem.php(127): Magento\Framework\Config\Reader\Filesystem->_readFiles(Object(Magento\Framework\Config\FileIterator))
#4 /opt/lampp/htdocs/magento2/vendor/magento/framework/App/ObjectManagerFactory.php(269): Magento\Framework\Config in /opt/lampp/htdocs/magento2/vendor/magento/framework/Config/Dom.php on line 364
i even installed dom by using below command
restarted the apache2 again but same error /
usser#user:/opt/lampp/htdocs/magento2$ sudo apt-get install php5.6-dom

Hey will you please try setup:upgrade command after removing generated files using following command..
rm -rf var/di var/generation var/cache var/page_cache var/view_preprocessed
The problem might not of the Dom may be.

Related

Lumen Dingo php artisan command error

I have installed Lumen, Dingo to test the JWT integration.
On terminal when I try to run unit test case using php artisan command it throws following error
PHP Fatal error: Call to undefined function Dingo\Api\Provider\config_path() in /usr/local/var/www/vhosts/storm/vendor/dingo/api/src/Provider/LaravelServiceProvider.php on line 26
PHP Stack trace:
PHP 1. {main}() /usr/local/var/www/vhosts/xxx/artisan:0
PHP 2. require() /usr/local/var/www/vhosts/xxx/artisan:18
PHP 3. Laravel\Lumen\Application->register() /usr/local/var/www/vhosts/storm/bootstrap/app.php:84
PHP 4. Illuminate\Container\Container->call() /usr/local/var/www/vhosts/storm/vendor/laravel/lumen-framework/src/Application.php:176
PHP 5. Illuminate\Container\BoundMethod::call() /usr/local/var/www/vhosts/storm/vendor/illuminate/container/Container.php:531
PHP 6. Illuminate\Container\BoundMethod::callBoundMethod() /usr/local/var/www/vhosts/storm/vendor/illuminate/container/BoundMethod.php:31
PHP 7. Illuminate\Container\BoundMethod::Illuminate\Container\{closure}() /usr/local/var/www/vhosts/storm/vendor/illuminate/container/BoundMethod.php:87
PHP 8. call_user_func_array:{/usr/local/var/www/vhosts/storm/vendor/illuminate/container/BoundMethod.php:30}() /usr/local/var/www/vhosts/storm/vendor/illuminate/container/BoundMethod.php:30
PHP 9. Dingo\Api\Provider\LaravelServiceProvider->boot() /usr/local/var/www/vhosts/storm/vendor/illuminate/container/BoundMethod.php:30
My composer.json:
"laravel/lumen-framework": "5.4.*",
"vlucas/phpdotenv": "~2.2",
"dingo/api": "1.0.*#dev",
"guzzlehttp/guzzle": "^6.2",
"lukasoppermann/http-status": "^2.0"
Any php artisan command is throwing above error.
I can only suspect that you registered the LaravelServiceProvider instead of using the LumenServiceProvider.
As Lumen does not have the helper function config_path() you're getting this error.
So according to the install instructions you should add
$app->register(Dingo\Api\Provider\LumenServiceProvider::class);
to your bootstrap/app.php.

PHP Fatal error: Class 'Phar' not found in

When I deploy my commits via Git to the server, it runs a git hook that has the line
test -f composer.phar && ./composer.phar self-update || curl -s http://getcomposer.org/installer | php;
That generates the error:
PHP Fatal error: Class 'Phar' not found in .../composer.phar on line 23
This is line 23 from composer.phar:
Phar::mapPhar('composer.phar');
I did search other questions with the same problem and checked these things:
git hook's script already has permission to be executed
I can execute ./composer.phar without error when logged in server and inside the same folder as set in the git hook's script
PHP modules has Phar enabled, checked via php -m
There is no extension=phar.so in php.ini, but I dont think it has to be because it's already enabled
PHP version: PHP 5.5.3 (cli)
What else could be causing this?

Postgresql9.5alpha1 installation error

I tried to install postgresql 9.5(alpha) Ubuntu, but after make world I got this error:
In file included from ../../../../src/include/postgres.h:47:0,
from varlena.c:15:
levenshtein.c: In function ‘varstr_levenshtein’:
../../../../src/include/c.h:726:7: error: static assertion failed: "Levenshtein hinting mechanism restricts NAMEDATALEN"
do { _Static_assert(condition, errmessage); } while(0)
levenshtein.c:104:2: note: in expansion of macro ‘StaticAssertStmt’
StaticAssertStmt(NAMEDATALEN <= MAX_LEVENSHTEIN_STRLEN,
levenshtein.c: In function ‘varstr_levenshtein_less_equal’:
../../../../src/include/c.h:726:7: error: static assertion failed: "Levenshtein hinting mechanism restricts NAMEDATALEN"
do { _Static_assert(condition, errmessage); } while(0)
levenshtein.c:104:2: note: in expansion of macro ‘StaticAssertStmt’
StaticAssertStmt(NAMEDATALEN <= MAX_LEVENSHTEIN_STRLEN,
make[4]: *** [varlena.o] Error 1
make[3]: *** [adt-recursive] Error 2
make[2]: *** [utils-recursive] Error 2
make[1]: *** [all-backend-recurse] Error 2
make: *** [world-src-recurse] Error 2
Does anybody have a suggestion?
In ubuntu you can install latest on this moment postgresql 9.5alpha2 from my ppa by this series of command from terminal:
sudo apt-add repository ppa:kazan417/postgresql
sudo apt-get update
sudo apt-get install postgresql-9.5 postgresql-contrib-9.5 postgresql-client-9.5
This commands not just install postgresql also it setup evrything you need for running postgresql.
Also you can install additional packages. or if you want harder way compile it from source by "dpkg-buildpackage" - this is better ubuntu way of compiling. And then installing by dpkg -i .
Here link you can find more info like dsc file and orig.tar.gz for compiling.

Error when tryingto compile LESS

I'm getting this error when trying to compile
lessc: ENOENT, open '/Users/William/Desktop/websites/grace/agency.less'
I'm using a MAC I've tried
$ lessc agency.less > agency.css & sudo lessc agency.less
same error. What am I doing wrong?

Raspbian dpkg error /var/lib/dpkg/triggers/File

I have just installed raspbian for my raspberry pi and I tried to install fswebcam with sudo apt-get install fswebcam and I get the error:
dpkg: error: syntax error in file triggers file `/var/lib/dpkg/triggers/File'
E: Sub-process /usr/bin/dpkg returned an error code (2)
I then thought about doing an update so did:
sudo apt-get update
sudo apt-get upgrade
This also produces the same error:
dpkg: error: syntax error in file triggers file `/var/lib/dpkg/triggers/File'
E: Sub-process /usr/bin/dpkg returned an error code (2)
The packages download but can not install.
Here is the cat of the file and it does seem wrong:
/usr/sharm/Ijbo0knsvadm-infO
▒e;{▒my
#▒q▒}db+/}sR+sh!reman man-db/uw▒>l▒caMom`O▒m!f)Er
/u3z/locax+#rcre/ma~--d▒
'6sZ/▒%▒Z6/maN ▒sn%ef▒e▒d/mqn`eaN-▒2
-T{3/,HbNarL-m(j▒Y▒gn?dabihF/▒yn/▒o▒u▒7s li▒g▒+b`.p%0;a▒m`f
)▒ks/lib/miG*mk▒En▒c lyb'dib2.-▒*armhf
/As▒5rx▒2E/▒xib-0.8.3c▒▒e"! ,cbomib2n0=zirmh/muk/Scil0ag/d%cAs▒o}sp%d#g/mime/packages miLe)cwrxfst
-u{s▒!▒kJ%/mho▒'qackawe;(S▒a▒'d▒m+/e-info
.5▒rlibog$j▒▒92bufm2.▒?:-1 ▒l▒qders libedc,pixbu&2.-2▒BiHf▒u▒b/diB)Az▒=nifT8▒wOuea▒ih$-gmj▒u▒.#}▒"▒`'2.10.0/loadgR{▒|i"gdN-#j▒▒▒f2.0-0>abolf-usr/s▒ar'/▒o▒6sb▒/n6Bonf+gusr-s``ve?ehosdw▒h{:5'fkod▒ g▒▒4!nO▒ig
/ts▒?{(I▒e->mYIf▒v▒nT1▒f4K▒nf+g
/usr/mi▒o▒rLoliNu▒=▒~u%abHHdlj▒:.0&▒▒ .0m▒mmduleS0▒9kg▒k:.)0:armh/}rr.l▒b/gtk-2.1/▒.10/p▒yL-gdules`liCgtk2.0d0▒D▒-(,+/ts▒'sHe2e-Bxymicatmozs0ndsktop-film,W▒a▒c
/usb/3``r▒/gcknv-defa}~D?▒o▒=▒f2X/5krH3▒u/▒c/,▒▒#~d!|opy(&Cg▒V4
/pSf-shaRe▒wcgnF+skhUi!{ gco~▒s▒5{r>u(a3e/Qo0pl▒r ;p▒f
/u3r.L▒▒prm-diFqX)gnuepb▒`f/gti-;o0/▒.l▒?iLmkve&Ls|▒0gTk▒#-0:qr-`f
w/0▒3~2./im▒od7|e,▒i`guk▒3-`*!Ex▒▒msr/sjarD▒unu!mandJ▒urR/▒yB/▒unu menu
/etc▒ee▒q-/eDH▒▒c }e.=
/Tsr/sha▒e/kcoos▒x▒color xi"▒▒o0-icon-theiesR▒y▒▒uoxc▒f3'gNo▒u onNme-i#on
▒▒e/'
I would prefer not having to re-install raspbian but I will if I must
Thanks
In the end I unfortunately had to format the sd card and reinstall raspbian. The output of the file is a lot more comprehensive now. I will put the contents at a later date.