Install Xdebug on Windows (PHP)

Simple steps for install XDebug on your Windows machine.
0. Write on test.php this code:

phpinfo();

1. Copy all informmation from phpinfo page.
2. Open https://xdebug.org/wizard.php and insert phpinfo to textarea
3. Click “Analyse my phpinfo() output” and follow to provided instructions
Something like:

  • Download php_xdebug-2.5.1-7.1-vc14.dll
  • Move the downloaded file to E:\xampp\php\ext
  • Update E:\xampp\php\php.ini and change the line zend_extension = E:\xampp\php\ext\php_xdebug-2.5.1-7.1-vc14.dll
  • Restart the webserver
$obj1 = new stdClass();
$obj1->name = 'A';
$obj1->date = date('Y-m-d H:i:s', 1458754362);
var_dump($result);

Happy debugging.

Yii requirements.php error after moving to /web folder.

If you get:

Error

The path to yii framework seems to be incorrect.

You need to install Yii framework via composer or adjust the framework path in file requirements.php.

Please refer to the README on how to install Yii.

Warning: require_once({your_site}/web/vendor/yiisoft/yii2/requirements/YiiRequirementChecker.php): failed to open stream: No such file or directory in {your_site}\web\requirements.php on line 23

Fatal error: require_once(): Failed opening required '{your_site}/web/vendor/yiisoft/yii2/requirements/YiiRequirementChecker.php' (include_path='...php\PEAR') in {your_site}\web\requirements.php on line 23

Then just change 14 line on:

$frameworkPath = dirname(__FILE__) . '/../vendor/yiisoft/yii2';

Happy codding.

Fast installing Yii framework

Steps:
0. If you do not already have Composer installed, you may do so by following the instructions at getcomposer.org.
1. Install Yii)

composer global require "fxp/composer-asset-plugin:^1.2.0"

and final

composer create-project --prefer-dist yiisoft/yii2-app-basic my_project_name

That’s all. Happy Codding.
Continue reading Fast installing Yii framework

Web-server on Ubuntu (PHP + MySQL + Apache) in 2 commands

Fast and easy install (PHP + MySQL + Apache) LAMP on Ubuntu

Step 1: install tasksel

sudo apt-get install tasksel

Step 2: Run install PHP, MySQL & Apache as LAMP server

sudo tasksel install lamp-server

Completed! Now you have installed PHP, MySQL, and Apache on your Ubuntu

Additional: Create site area
Continue reading Web-server on Ubuntu (PHP + MySQL + Apache) in 2 commands