Script to locate php.ini

Simple script to locate php.ini file from your directory.

Save this script in a php file let’s say locate-php-ini.php. Access the file from your local server. It will show exact path location.
$inipath = php_ini_loaded_file();

if ($inipath) {
echo 'Loaded php.ini: ' . $inipath;
} else {
echo 'A php.ini file is not loaded';

Output would be like:ย Loaded php.ini: /Applications/XAMPP/xamppfiles/etc/php.ini

“Could not reliably determine the serverโ€™s fully qualified domain name, using for ServerName”

When Apache is running in Ubuntu, one might get this message while starting or stopping the service.ย First of all this isn’t error! It’s just a friendly warning. How to get rid of this? Instructions below.

13.04 and older

If you insert a

ServerName localhost   

in either httpd.conf or apache2.conf in /etc/apache2 and restart apache the notice will disappear.

If you have a name inside /etc/hostname you can also use that name instead of localhost.

And it uses if it is inside your /etc/hosts: localhost myhostname

Preferred method

Troubleshooting Apache

If you get this:

apache2: Could not determine the server's fully qualified domain name, 
using for ServerName

then use a text editor such as “sudo nano” at the command line or “gksudo gedit” on the desktop to create a new file,

sudo nano /etc/apache2/conf.d/fqdn


gksu "gedit /etc/apache2/conf.d/fqdn"

then add

ServerName localhost

to the file and save.

But on Ubuntu 14.04:

 echo "ServerName localhost" | sudo tee /etc/apache2/conf-available/fqdn.conf
 sudo a2enconf fqdn

Don’t forget the “.conf” (without will not work).


Source: askubuntu


Rather than having to call / include a file you need on every single page, you can have them automatically prepended (top of file) or appended (bottom of file) automatically through your .htaccess file.

php_value auto_prepend_file "/real/path/to/file/functions.php"
php_value auto_append_file "/real/path/to/file/footer.php"