PHP the acronym of Hypertext
The preferred locations of PHP in Unix system:
If PHP is installed on your system and doesn’t know its location, you can easily find it using some quick techniques.
If you have root access to your system and have a little idea about the command prompt, a single line of code is enough to display the PHP location. You can use PUTTY software.PuTTY is a free SSH and telnet client for Windows and Unix platforms, along with an
The location of the PHP installation is displayed. Now type,
PHP location with php.ini file and other details are displayed. You can check the above screenshot to know how to use the code in the command prompt.
If you are installed on your Windows computer for testing purpose. The preferred location is: C:\program files\php
There is one more method to view your PHP installation path and other details. This is useful if you don’t have any access to your server. If you are using a shared hosting environment you can follow this method. But you need to create a webpage with a simple PHP script and place it in your server. In a normal text editor like notepad create a file like phpinfo.php or some other with the following code:
<?php phpinfo(); ?>
Save the file as .php or as a .html file (eg: phpinfo.php). Upload this file to your websites main directory like the public_html directory or some other directory. Open your favorite browser, in the address bar type,
http://yourdomain.com/yourfile.php (in this case, http://yourdomain.com/phpinfo.php). A detailed page with PHP version installed, the location of the php.ini file and other details related with your PHP installation will also be displayed. You can easily get some readymade
‘phpinfo.php’ file from different sites, but before using it, just open it in notepad or some other apps to ensure the code doesn’t contain any other malicious or tracking code.