Where is php.ini located?

php.ini can be located in quite few different places depending on your Linux distribution and Apache installation.

Some common places are:
/etc/php.ini
/etc/php/php.ini
/etc/php5/php.ini
/etc/php5/apache2/php.ini
/usr/bin/php5/bin/php.ini


If you still can't find it, run:
find / -name php.ini
This will find all files with name php.ini on your server.


MySQL server down: ERROR 2002 (HY000)

Problem:

  • All Joomla websites hosted on single virtual server are down.
  • Trying to access any of the sites, web browsers display following errors:
    Infinite loop detected in JError

    or
    Database Error: Unable to connect to the database:Could not connect to MySQL
  • phpMyAdmin web interface displays login screen would not allow to login (simply reloads the page after submitting credentials).
  • Trying to connect to MySQL via console fails with errors:
    ERROR 1040 (hy000): Too many connections
    or
    ERROR 2002   (HY000): Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2)

Read more: MySQL server down: ERROR 2002 (HY000)

Unlock network files locked by Samba Linux / Unix Server

Samba is a free Linux/Unix software which provides file and print access for Microsoft Windows clients. If you have a Linux file server or Linux based NAS device on a network with Windows clients you are probably using Samba.

Samba deals with file locking, preventing file corruption and data loss when two or more clients try to simultaneously edit the same file. There may be situations where you need to force file unlock, for example when file was closed but lock was not properly released by Samba.

Unfortunately Samba doesn't allow unlocking individual files. There are couple of workarounds though.

Read more: Unlock network files locked by Samba Linux / Unix Server

Installing LDAP support in PHP on Ubuntu LAMP server

LDAP support in PHP is not enabled by default. To enable LDAP support on an existing Ubuntu Apache web server you need to install php5-ldap package.
 
Install php5-lda:
sudo apt-get install php5-ldap
Reboot apache
/etc/init.d/apache2 restart

Read more: Installing LDAP support in PHP on Ubuntu LAMP server