Maria Tsourma Maria Tsourma - 4 months ago 9x
MySQL Question

Cannot access my webpage after setting a new user in php

I work on Ubuntu 12.04 with MySQL and LAMPP. I run some commands in order to make a new user and gain extra privileges for executing "chmod" and "exec" commands in PHP.

After the set up of the new user, when I try to log in to my site I get the error below:

Connection failed: SQLSTATE[HY000] [1045]

Also, I cannot login to "localhost/phpmyadmin", and I see the following error:

2002 - No such file or directory The server is not responding (or the local server's socket is not correctly configured).

I tried to find a way to revoke the new user's privileges, but I found nothing.
With the "whoami" command in PHP I get the new user's name.

Could you please help me?


You can try:

For Apache:

chown www-data:www-data /var/www -R
chmod 755 /var/www -R
addgroup your_user www-data


chown vaggos:vaggos /opt/lampp -R 
chmod 755 /opt/lampp -R 
addgroup your_user vaggos

For temp folder:

chown vaggos:vaggos /temp -R 
chmod 755 /temp -R 


chown www-data:www-data /temp -R 
chmod 755 /temp -R 

Check this for more detailed information: How to fix permission of htdocs in Ubuntu

If this answer was usefull, give +1 ;)