Very interesting code snippet that is about to display colorful output with PHP-CLI
Category: Programming
Read articles, tips & tutorials, news and updates on programming language. I write on mostly all languages and try to share my experience with you so you don’t need to spent too much time to find the solution by yourself. Sharing is the true power of knowledge.
I am using nginx server for this documentation. First of all just choose a directory where you are gonna keep all your appliction files. Suppose, /var/www is going to be that directory.Create a directory and rename it with yourapplication-name. Inside that directory just create few pre-planned directory and file structure like the following. │ ├── routes ├── src ├── utilities ├── public ├── img ├── js ├── css ├── index.php ├── templates ├── composer.json We will manage and install all …
To enable xDebug in your nginx server you just first install xdebug by pecl command. sudo pecl install xdebug Now xdebug is installed in your system. Now find exactly where xdebug.so file was downloaded. You have to find it in /usr/lib/php5/(somewhere in this directory) Now after find the xdebug.so you have to open your PHP5-FPM’s php.ini file with sudo gedit /etc/php5/fpm/php.ini and add the following command (to locate the xdebug and enabling it). zend_extension=locationOfYourxDebugfile xdebug.remote_port=9000 xdebug.remote_enable=On xdebug.remote_connect_back=On xdebug.remote_log=/var/log/xdebug.log Now restart …
To use XAMPP’s PHP as default PHP in your command line to execute PHP commands fromyour command line/prompt you have to just follow the simple steps mentioned below: in this tutorial I used UBUNTU as my OS Open your terminal and open .bashrc file by following command: If you don’t use GUI or gedit not installed then you can use vim instead of gedit like following and just you have to add the following line at the end of your …
Today in my new PC I was just using a PHP application and I saw a error that says the following error: PHP Warning: strtotime(): It is not safe to rely on the system's timezone settings. You are required to use the date.timezone setting or the date_default_timezone_set() function Then I just figured out that I installed the latest version of PHP manually and in my php.ini file I didn’t tell PHP about my default timezone. Now I just open my …