Category: PHP
-
How to check whether PHP is installed in Mac?
To check the whether PHP is installed in Mac, open the terminal and type php -v. This will display the PHP version installed in the system.
-
How to know browser information of Visitor?
In order to check what sort of browser the visitor is using, we can make use of the user agent string the browser sends as a part of HTTP request. $_SERVER[‘HTTP_USER_AGENT’] $_SERVER is a special reserved PHP variable that contains all web server information. It is known as superglobals.
-
How to get system information using php?
In order to get system information, we can make use of php command: phpinfo()
-
Printing to terminal from Laravel App.
When we want to debug laravel stuff and running a *php artisan serve* on a terminal window, we would like to have a utility similar to printf in C, println in Java.. etc. This can be achieved by the following lines of code: Run your Laravel app and you can see something like below:
-
Install php mcrypt in Mac OS Sierra 10.12
# Install HomeBrew. (https://brew.sh/) $/usr/bin/ruby -e “$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)” Disable SIP in Mac OS. (http://www.macworld.com/article/2986118/security/how-to-modify-system-integrity-protection-in-el-capitan.html) The Sierra version ships with PHP 5.6.28 at the time of writing, you can always find the version from your terminal with php -v command. Download the version source from the PHP site (http://php.net/downloads.php) and extract it. Make sure you enable […]