Tuesday, November 7, 2017

phpmyadmin exporting html in place of sql

Solution :

Add/Uncomment following attribute in php.ini

max_input_vars = 5000
Restart Apache.

FATAL: Peer authentication failed for user "postgres"

psql dump database from other user without loginto postgres user

$ whoami
ubuntu

$ pg_dump -U postgres dbname > db.sql
FATAL:  Peer authentication failed for user "postgres"


Solution :

sudo nano /etc/postgresql/9.4/main/pg_hba.conf

Change

local   all             postgres                                peer
to
local   all             postgres                                trust


Restart postgresql.

mysqli::mysqli(): Headers and client library minor version mismatch. Headers:50552 Library:100120


In centos or fedora, If you are facing above error.

Solution :


yum remove php56w-mysql

yum install php56w-mysqlnd

I used php56  in command as I installed php with php56 package because I wanted php 5.6 on my server. If you have installed php using simple php or php5 command, remove php-mysql or php5-mysql package and install php-mysqlnd or php5-mysqlnd.

Restart apache and verify the issue. It should be fixed.

Error: EACCES: permission denied, mkdir 'node_modules/node-sass'



Unable to save binary /usr/lib/node_modules/node-sass/vendor/linux-x64-57 : { Error: EACCES: permission denied, mkdir '/usr/lib/node_modules/node-sass/vendor'
    at Object.fs.mkdirSync (fs.js:891:18)
    at sync (/usr/lib/node_modules/node-sass/node_modules/mkdirp/index.js:71:13)
    at Function.sync (/usr/lib/node_modules/node-sass/node_modules/mkdirp/index.js:77:24)
    at checkAndDownloadBinary (/usr/lib/node_modules/node-sass/scripts/install.js:111:11)
    at Object.<anonymous> (/usr/lib/node_modules/node-sass/scripts/install.js:154:1)
    at Module._compile (module.js:573:30)
    at Object.Module._extensions..js (module.js:584:10)
    at Module.load (module.js:507:32)
    at tryModuleLoad (module.js:470:12)
    at Function.Module._load (module.js:462:3)



You are trying these commands in project directory
sudo npm install node-sass
or
npm install node-sass
and it is giving above error and module is not getting installed.

Solution :

sudo chmod -R 777 projectfolder
Now it has sufficient permission to create files inside it. 
Do not use sudo with npm, it does not need root access to install package(module).
Now Run :
npm install node-sass
Now it will be installed. You can give correct permission to folder and files again, 777 is a security breach. We just made it for installing this module.

Magento Installation Error : set always_populate_raw_post_data to -1

Magento Installation Error :

PHP Settings Check * Need Help? PHP Documentation Your PHP Version is 5.6.30, but always_populate_raw_post_data = 0. $HTTP_RAW_POST_DATA is deprecated from PHP 5.6 onwards and will be removed in PHP 7.0. This will stop the installer from running. Please open your php.ini file and set always_populate_raw_post_data to -1. If you need more help please call your hosting provider.

Solution :
 Open .htaccess file of magento and add line php_value always_populate_raw_post_data -1 between tags <IfModule mod_php5.c> and </IfModule>

<IfModule mod_php5.c>    php_value always_populate_raw_post_data -1
</IfModule>


Now Try to install again. You should not get same error again.