#PHP
http://www.codecademy.com/en/tracks/php
http://www.tutorialspoint.com/php/index.htm
http://www.phptherightway.com/
https://github.com/zmwebdev/PHPcookbook-code-3ed
https://github.com/codeguy/modern-php
http://wasil.org/sublime-text-3-perfect-php-development-set-up
###Servers
MAC
https://bitnami.com/stack/mamp
Windows
Portable: http://www.usbwebserver.net/en/
https://help.ubuntu.com/14.04/serverguide/php5.html
$ sudo apt-get install php5 libapache2-mod-php5
Create a workspace:
$ mkdir ~/workspace
$ sudo ln -s ~/workspace /var/www/html/workspace
http://localhost/workspace
Start PHP server:
http://php.net/manual/en/features.commandline.webserver.php
$ php -S localhost:8000
$ php -S localhost:8000 -t foo/
You can make the web server accessible on port 8000 to any interface with:
$ php -S 0.0.0.0:8000
Access using:
http://localhost:8000/filename.php
With Apache:
http://localhost/.../.../filename.php
logs in Apache:
$ tail -f /var/log/apache2/error.log
php.ini:
/etc/php5/apache2/php.ini
###HTTP request
curl, postman, ...
##IDE
SublimeText:
http://wasil.org/sublime-text-3-perfect-php-development-set-up
https://www.jetbrains.com/phpstorm/
##Errors
http://www.phptherightway.com/#error_reporting
####With Aptana:
http://php.tutorialhorizon.com/how-to-debug-php-in-aptana-studio-for-linux-part-1/
####With c9.io:
https://github.com/c9/c9.ide.run.debug.xdebug
https://c9.io/blog/debug-your-php-code-with-xdebug-and-cloud9/
- Open the script you want to debug, for example index.php
- Set at least one breakpoint
- Choose Run > Run With > PHP (built-in web server)
####With SublimeText:
http://stackoverflow.com/questions/5504152/is-it-possible-to-use-xdebug-on-ubuntu
http://askubuntu.com/questions/503751/configure-xdebug-ubuntu-14-04
http://www.youtube.com/watch?v=Zk87LSbxLtw
https://github.com/martomo/SublimeTextXdebug
http://www.sitepoint.com/debugging-xdebug-sublime-text-3/
Install:
In sublimeText:
https://packagecontrol.io/packages/Xdebug%20Client
In linux:
$ sudo apt-get install php5-xdebug
you should change your /etc/php5/apache2/conf.d/20-xdebug.ini and add this line:
zend_extension=/path/to/your/xdebug.so
xdebug.remote_enable = 1
then
$ sudo service apache2 restart
Install xdebug in sublimetext using package manager
in sublime text, project -> save project as, and save in the root. Add this:
{
"folders":
[
{
"follow_symlinks": true,
"path": "/home/../workspace"
}
],
"settings": {
"xdebug": {
"url": "http://localhost/.../"
}
}
}
Use chrome addon: Xdebug helper
###HHVM HHVM is an open-source virtual machine designed for executing programs written in Hack and PHP:
###phpbrew phpbrew builds and installs multiple version php(s) in your $HOME directory.