Forked from DaRaFF/ubuntu-php-development-environment.md
Last active
December 30, 2015 08:59
-
-
Save alexcodenet/7805956 to your computer and use it in GitHub Desktop.
Revisions
-
alexcodenet revised this gist
Dec 9, 2013 . 1 changed file with 4 additions and 24 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -40,13 +40,11 @@ sudo apt-get install apache2 sudo apt-get install libapache2-mod-php5 sudo a2enmod rewrite ``` <a name="php"></a> ##PHP5 ```shell sudo apt-get install php5-cli php5-common php5 php5-dev ``` <a name="mysql"></a> ##MySQL ```shell @@ -56,10 +54,8 @@ sudo apt-get install php5-mysql #Installation PHP QA Environment <a name="phpunit"></a> ##PHPUnit ```shell sudo pear channel-discover pear.phpunit.de sudo pear update-channels @@ -82,7 +78,6 @@ sudo pear install --force phpunit/PHPUnit_MockObject sudo apt-get install php5-xdebug ``` *edit /etc/php5/mods-available/xdebug.ini ```shell zend_extension=/usr/lib/php5/YOUR_DIR/xdebug.so xdebug.remote_enable=on @@ -123,37 +118,32 @@ chmod 0755 /home/username/GitHubProjects/.ssh #General Environment <a name="memcache"></a> ##memcache ```shell sudo apt-get install memcached sudo apt-get install php5-memcache ``` <a name="curl"></a> ##cURL ```shell sudo apt-get install curl sudo apt-get install php5-curl ``` <a name="composer"></a> ##Composer ```shell curl -sS https://getcomposer.org/installer | php sudo mv composer.phar /usr/local/bin/composer ``` #Zend Framework <a name="zf1"></a> ##Zend Framework 1.12 *download the latest release of Zend Framework (http://framework.zend.com/downloads/) ```shell tar -xzvf ZendFramework-1.12.3.tar.gz sudo mkdir /usr/local/lamp @@ -164,22 +154,18 @@ ln -s /usr/local/ZendFramework-1.12.3/bin/zf.sh /usr/bin/zf zf show version ``` *edit /etc/php5/apache2/php.ini ```shell include_path = ".:/usr/share/php:/usr/local/ZendFramework-1.12.3/library" ``` <a name="zf2"></a> ##Zend Framework 2 ```shell sudo git clone https://github.com/zendframework/ZendSkeletonApplication /usr/local/lamp ``` or for use with netbeans just download .zip and move to /usr/local/lamp <a name="vhosts"></a> ##Create virtual host *add to /etc/vhosts ```shell 127.0.0.1 example.localhost @@ -208,13 +194,11 @@ a2ensite example.localhost /etc/init.d/apache2 restart ``` #IDE <a name="jdk"></a> ##Oracle JDK 7 *recommended download the latest Oracle JDK (http://www.oracle.com/technetwork/java/javase/downloads/index.html) ```shell tar -xvf jdk-7u45-linux-x64.tar.gz sudo mkdir -p /usr/lib/jvm @@ -235,7 +219,6 @@ javaws -version ln -s /usr/lib/jvm/jdk1.7.0/jre/lib/amd64/libnpjp2.so /usr/lib/mozilla/plugins/ ``` *edit /etc/apparmor.d/abstractions/ubuntu-browsers.d/java ```shell # /usr/lib/jvm/java-*-sun-1.*/jre/bin/java{,_vm} cx -> browser_java, # /usr/lib/jvm/java-*-sun-1.*/jre/lib/*/libnp*.so cx -> browser_java, @@ -250,18 +233,15 @@ check java: http://java.com/en/download/installed.jsp <a name="netbeans"></a> ##NetBeans 7.4 *Download the latest version of NetBeans for PHP (https://netbeans.org/downloads/) ```shell chmod +x netbeans.sh ./netbeans.sh ``` <a name="sublime"></a> ##Sublime Text 2 *Download the latest version of Sublime Text 2 (http://www.sublimetext.com/2) ```shell tar xf Sublime\ Text\ 2.0.2\ x64.tar.bz2 sudo mv Sublime\ Text\ 2 /opt/ -
alexcodenet revised this gist
Dec 9, 2013 . 1 changed file with 1 addition and 2 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -103,8 +103,7 @@ git config --global user.email newuser@example.com ``` <a name="ssh"></a> #SSH ```shell mkdir /home/username/.ssh cd .ssh -
alexcodenet revised this gist
Dec 9, 2013 . 1 changed file with 1 addition and 0 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -289,4 +289,5 @@ TargetEnvironment=Unity and replace gedit.desktop with sublime.desktop In case of problems with the display icon in the Dash *edit /home/username/.local/share/applications/sublime-desktop -
alexcodenet revised this gist
Dec 9, 2013 . 1 changed file with 83 additions and 2 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -153,7 +153,7 @@ sudo mv composer.phar /usr/local/bin/composer <a name="zf1"></a> ##Zend Framework 1.12 *download the latest release of Zend Framework (http://framework.zend.com/downloads/) ```shell tar -xzvf ZendFramework-1.12.3.tar.gz @@ -168,7 +168,6 @@ zf show version ```shell include_path = ".:/usr/share/php:/usr/local/ZendFramework-1.12.3/library" ``` <a name="zf2"></a> @@ -209,3 +208,85 @@ or for use with netbeans just download .zip and move to /usr/local/lamp a2ensite example.localhost /etc/init.d/apache2 restart ``` #IDE <a name="jdk"></a> ##Oracle JDK 7 *recommended download the latest Oracle JDK (http://www.oracle.com/technetwork/java/javase/downloads/index.html) ```shell tar -xvf jdk-7u45-linux-x64.tar.gz sudo mkdir -p /usr/lib/jvm mv jdk1.7.0 /usr/lib/jvm/ update-alternatives --install "/usr/bin/java" "java" "/usr/lib/jvm/jdk1.7.0/bin/java" 1 update-alternatives --install "/usr/bin/javac" "javac" "/usr/lib/jvm/jdk1.7.0/bin/javac" 1 update-alternatives --install "/usr/bin/javaws" "javaws" "/usr/lib/jvm/jdk1.7.0/bin/javaws" 1 chmod a+x /usr/bin/java chmod a+x /usr/bin/javac chmod a+x /usr/bin/javaws chown -R username:username /usr/lib/jvm/jdk1.7.0 update-alternatives --config java java -version update-alternatives --config javac javac -version update-alternatives --config javaws javaws -version ln -s /usr/lib/jvm/jdk1.7.0/jre/lib/amd64/libnpjp2.so /usr/lib/mozilla/plugins/ ``` *edit /etc/apparmor.d/abstractions/ubuntu-browsers.d/java ```shell # /usr/lib/jvm/java-*-sun-1.*/jre/bin/java{,_vm} cx -> browser_java, # /usr/lib/jvm/java-*-sun-1.*/jre/lib/*/libnp*.so cx -> browser_java, /usr/lib/jvm/jdk*/jre/bin/java{,_vm} cx -> browser_java, /usr/lib/jvm/jdk*/jre/lib/*/libnp*.so cx -> browser_java, ``` ```shell /etc/init.d/apparmor restart ``` check java: http://java.com/en/download/installed.jsp <a name="netbeans"></a> ##NetBeans 7.4 *Download the latest version of NetBeans for PHP (https://netbeans.org/downloads/) ```shell chmod +x netbeans.sh ./netbeans.sh ``` <a name="sublime"></a> ##Sublime Text 2 *Download the latest version of Sublime Text 2 (http://www.sublimetext.com/2) ```shell tar xf Sublime\ Text\ 2.0.2\ x64.tar.bz2 sudo mv Sublime\ Text\ 2 /opt/ ln -s /opt/Sublime\ Text\ 2/sublime_text /usr/bin/sublime ``` *create /usr/share/applications/sublime.desktop ```shell [Desktop Entry] Version=1.0 Name=Sublime Text 2 GenericName=Text Editor Exec=sublime Terminal=false Icon=/opt/Sublime Text 2/Icon/48x48/sublime_text.png Type=Application Categories=TextEditor;IDE;Development X-Ayatana-Desktop-Shortcuts=NewWindow [NewWindow Shortcut Group] Name=New Window Exec=sublime -n TargetEnvironment=Unity ``` *edit /usr/share/applications/defaults.list and replace gedit.desktop with sublime.desktop In case of problems with the display icon in the Dash *edit /home/username/.local/share/applications/sublime-desktop -
alexcodenet revised this gist
Dec 9, 2013 . 1 changed file with 63 additions and 0 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -24,6 +24,7 @@ I hope it helps you too! * Zend Framework * [Zend Framework 1.12](#zf1) * [Zend Framework 2](#zf2) * [Create virual host](#vhosts) * IDE * [Oracle JDK 7](#jdk) * [NetBeans 7.4](#netbeans) @@ -146,3 +147,65 @@ curl -sS https://getcomposer.org/installer | php sudo mv composer.phar /usr/local/bin/composer ``` #Zend Framework <a name="zf1"></a> ##Zend Framework 1.12 *download the latest release Zend Framework 1 (http://framework.zend.com/downloads/) ```shell tar -xzvf ZendFramework-1.12.3.tar.gz sudo mkdir /usr/local/lamp mv ZendFramework-1.12.3 /usr/local/lamp chmod 0755 ZendFramework-1.12.3 chmod -R 0755 ZendFramework-1.12.3/* ln -s /usr/local/ZendFramework-1.12.3/bin/zf.sh /usr/bin/zf zf show version ``` *edit /etc/php5/apache2/php.ini ```shell include_path = ".:/usr/share/php:/usr/local/ZendFramework-1.12.3/library" ``` <a name="zf2"></a> ##Zend Framework 2 ```shell sudo git clone https://github.com/zendframework/ZendSkeletonApplication /usr/local/lamp ``` or for use with netbeans just download .zip and move to /usr/local/lamp <a name="vhosts"></a> ##Create virtual host *add to /etc/vhosts ```shell 127.0.0.1 example.localhost ``` *create /etc/apache2/sites-available/example.localhost.conf ```shell <VirtualHost *:80> ServerName example.localhost DocumentRoot /home/username/localhost/example.localhost/public/ <Directory /home/username/localhost/example.localhost/public/ > DirectoryIndex index.php AllowOverride All Order allow,deny Allow from all Require all granted </Directory> ErrorLog ${APACHE_LOG_DIR}/error.log CustomLog ${APACHE_LOG_DIR}/access.log combined </VirtualHost> ``` ...and ```shell a2ensite example.localhost /etc/init.d/apache2 restart ``` -
alexcodenet revised this gist
Dec 9, 2013 . 1 changed file with 8 additions and 2 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -91,13 +91,17 @@ xdebug.remote_port=9000 xdebug.idekey="netbeans-xdebug" ``` #GitHub support <a name="git"></a> ##Git ```shell sudo apt-get install git git config --global user.name "NewUser" git config --global user.email newuser@example.com ``` <a name="ssh"></a> #Using SSH ```shell @@ -117,6 +121,7 @@ cp ~/.ssh/id_rsa /home/username/GitHubProjects/.ssh chmod 0755 /home/username/GitHubProjects/.ssh ``` #General Environment <a name="memcache"></a> @@ -139,4 +144,5 @@ sudo apt-get install php5-curl ```shell curl -sS https://getcomposer.org/installer | php sudo mv composer.phar /usr/local/bin/composer ``` -
alexcodenet revised this gist
Dec 9, 2013 . 1 changed file with 41 additions and 4 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -19,8 +19,8 @@ I hope it helps you too! * [SSH](#ssh) * General Environment * [memcache](#memcache) * [cURL](#curl) * [Composer](#composer) * Zend Framework * [Zend Framework 1.12](#zf1) * [Zend Framework 2](#zf2) @@ -50,6 +50,7 @@ sudo apt-get install php5-cli php5-common php5 php5-dev ##MySQL ```shell sudo apt-get install mysql-server sudo apt-get install php5-mysql ``` @@ -100,6 +101,42 @@ git config --global user.email newuser@example.com #Using SSH ```shell mkdir /home/username/.ssh cd .ssh ssh-keygen -t rsa -C "your_email@example.com" //specify your current location ssh-add id_rsa ssh -T git@github.com //if "The authenticity of host 'github.com' can't be established." error //start ssh-agent env | grep ^SSH exec ssh-agent bash ssh-add id_rsa //if netbeans reports an error ssh-key permission denied cp ~/.ssh/id_rsa /home/username/GitHubProjects/.ssh chmod 0755 /home/username/GitHubProjects/.ssh ``` #General Environment <a name="memcache"></a> ##memcache ```shell sudo apt-get install memcached sudo apt-get install php5-memcache ``` <a name="curl"></a> ##cURL ```shell sudo apt-get install curl sudo apt-get install php5-curl ``` <a name="composer"></a> ##Composer ```shell curl -sS https://getcomposer.org/installer | php sudo mv composer.phar /usr/local/bin/composer ``` -
alexcodenet revised this gist
Dec 9, 2013 . 1 changed file with 11 additions and 134 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -58,7 +58,6 @@ sudo apt-get install mysql-server <a name="phpunit"></a> ##PHPUnit ```shell sudo pear channel-discover pear.phpunit.de sudo pear update-channels @@ -83,146 +82,24 @@ sudo apt-get install php5-xdebug *edit /etc/php5/mods-available/xdebug.ini ```shell zend_extension=/usr/lib/php5/YOUR_DIR/xdebug.so xdebug.remote_enable=on xdebug.remote_host=localhost xdebug.remote_handler=dbgp xdebug.remote_port=9000 xdebug.idekey="netbeans-xdebug" ``` <a name="git"></a> ##GitHub support ```shell sudo apt-get install git git config --global user.name "NewUser" git config --global user.email newuser@example.com ``` #Using SSH ```shell ssh-keygen -t rsa -C "WHICHEVER_TEXT" ssh-add id_rsa ``` -
alexcodenet revised this gist
Dec 9, 2013 . 1 changed file with 45 additions and 52 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -8,95 +8,88 @@ I hope it helps you too! #Installation stack * LAMP Environment * [Apache2](#apache2) * [PHP5](#php) * [MySQL](#mysql) * PHP QA Environment * [PHPUnit](#phpunit) * [xDebug](#xdebug) * GitHub support * [Git](#git) * [SSH](#ssh) * General Environment * [memcache](#memcache) * [curl](#curl) * [composer](#composer) * Zend Framework * [Zend Framework 1.12](#zf1) * [Zend Framework 2](#zf2) * IDE * [Oracle JDK 7](#jdk) * [NetBeans 7.4](#netbeans) * [Sublime Text 2](#sublime) #Installation LAMP Environment <a name="apache2"></a> ##Apache2 ```shell sudo apt-get install apache2 sudo apt-get install libapache2-mod-php5 sudo a2enmod rewrite ``` <a name="php"></a> ##PHP5 ```shell sudo apt-get install php5-cli php5-common php5 php5-dev ``` <a name="mysql"></a> ##MySQL ```shell sudo apt-get install mysql-server ``` #Installation PHP QA Environment <a name="phpunit"></a> ##PHPUnit #install newest version of phpunit ```shell sudo pear channel-discover pear.phpunit.de sudo pear update-channels sudo pear upgrade-all sudo pear config-set auto_discover 1 sudo pear install --alldeps pear.phpunit.de/PHPUnit sudo pear install --force --alldeps pear.phpunit.de/PHPUnit ``` #phpunit extensions ```shell sudo pear install pear.phpunit.de/PHPUnit_SkeletonGenerator sudo pear install pear.phpunit.de/DbUnit sudo pear install --force phpunit/PHPUnit_MockObject ``` <a name="xdebug"></a> ##xDebug ```shell sudo apt-get install php5-xdebug ``` *edit /etc/php5/mods-available/xdebug.ini ```shell zend_extension=/usr/lib/php5/20121212/xdebug.so xdebug.remote_enable=on xdebug.remote_host=localhost xdebug.remote_handler=dbgp xdebug.remote_port=9000 xdebug.idekey="netbeans-xdebug" ``` #Configuration <a name="php-ini"></a> -
alexcodenet revised this gist
Dec 8, 2013 . 1 changed file with 21 additions and 148 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,45 +1,33 @@ #Introduction If you're a PHP developer on Ubuntu 13.10, there comes the time where you have to install/reinstall your system. I did it already a few times and i decided to write down the steps for a typical web developer stack with PHP. This is for a developer machine and not for a live environment! I hope it helps you too! #Installation stack * LAMP Environment * [PHP5](#php) * General Environment * [git / github](#git) * [memcache](#memcache) * [apache2](#apache2) * [mysql](#mysql) * [curl](#curl) * PHP QA Environment * [PHPUnit](#phpunit) * [NetBeans IDE](#netbeans) * Other * [php.ini settings](#php-ini) * [How to debug with XDebug and Netbeans](#debugging-with-netbeans) * [Apache2 config example](#apache2-config-example) #Installation PHP Environment <a name="php"></a> ##PHP5 ```shell sudo apt-get install php5-cli php5-common php-pear php5-xdebug php5-curl php5 php5-dev ``` <a name="pear"></a> @@ -49,24 +37,13 @@ sudo pear channel-update PEAR sudo pear upgrade PEAR ``` #Install General Environment <a name="git"></a> ##git ```shell sudo apt-get install git <a name="memcache"></a> ##memcache ```shell @@ -82,43 +59,13 @@ sudo a2enmod rewrite sudo apt-get install libapache2-mod-php5 ``` <a name="mysql"></a> ##mysql ```shell sudo apt-get install mysql-server sudo apt-get install php5-mysql ``` <a name="curl"></a> ##curl @@ -127,64 +74,35 @@ sudo apt-get install curl ``` #Installation PHP QA Environment <a name="phpunit"></a> ##PHPUnit #install newest version of phpunit sudo pear channel-discover pear.phpunit.de sudo pear update-channels sudo pear upgrade-all sudo pear config-set auto_discover 1 sudo pear install --alldeps pear.phpunit.de/PHPUnit sudo pear install --force --alldeps pear.phpunit.de/PHPUnit #phpunit Skeleton Generator sudo pear install pear.phpunit.de/PHPUnit_SkeletonGenerator sudo pear install pear.phpunit.de/DbUnit ``` <a name="phpstorm"></a> ##NetBeans IDE * Download and install NetBeans IDE for PHP - https://netbeans.org/downloads/ * Download Oracle JDK - http://www.oracle.com/technetwork/java/javase/downloads/index.html #Configuration <a name="php-ini"></a> ##PHP * Change this settings in /etc/php5/cli/php.ini for for *all webservers* * Change this settings in /etc/php5/apache2/php.ini if you have installed *apache2* ```shell memory_limit = 512m @@ -202,15 +120,15 @@ xdebug.max_nesting_level = 1000 ``` <a name="debugging-with-phpstorm"></a> #Debugging with XDebug on Browser The example is made for NetBeans IDE with Apache2 WebServer. But other IDE's or webservers should work in a similar way. ##Configuration ```shell #Edit /etc/php5/cli/conf.d/xdebug.ini xdebug.remote_enable=On xdebug.remote_host=localhost xdebug.remote_port=9000 xdebug.remote_handler=dbgp xdebug.profiler_append=Off xdebug.profiler_enable=Off @@ -219,50 +137,10 @@ xdebug.profiler_output_dir="/tmp/kcachegrind" sudo service apache2 restart <a name="apache2-config-example"></a> #Apache2 config example (with Zend Framework framework) Assume you want to have your project in `/home/username/localhost` ```shell # Change user/group of Apache2 @@ -277,15 +155,10 @@ Group <usergroup> /etc/apache2/sites-available/www.my_webside.lo #edit file (with example config) #create symbolic link to enable a site #restart apache sudo /etc/init.d/apache2 restart -
DaRaFF revised this gist
Oct 13, 2013 . No changes.There are no files selected for viewing
-
DaRaFF revised this gist
Oct 13, 2013 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -5,7 +5,7 @@ This is for a developer machine and not for a live environment! I hope it helps you too! fyi [@mheiniger](https://github.com/mheiniger) and [me](https://github.com/DaRaFF) started with an installer here: https://github.com/mheiniger/webdev-setup #Installation stack -
DaRaFF revised this gist
Oct 13, 2013 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -5,7 +5,7 @@ This is for a developer machine and not for a live environment! I hope it helps you too! fyi [@mheiniger](https://github.com/mheiniger) and me started with an installer here: https://github.com/mheiniger/webdev-setup #Installation stack -
DaRaFF revised this gist
Oct 13, 2013 . 1 changed file with 5 additions and 2 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,9 +1,12 @@ #Introduction If you're a php developer on ubuntu, there comes the time where you have to install/reinstall your system. I did it already a few times and i decided to write down the steps for a typical web developer stack with php. This is for a developer machine and not for a live environment! I hope it helps you too! fyi @mheiniger and me started with an installer here: https://github.com/mheiniger/webdev-setup #Installation stack * PHP Environment -
DaRaFF revised this gist
Oct 13, 2013 . 1 changed file with 27 additions and 27 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -6,6 +6,10 @@ This is for a developer machine and not for live environment! I hope it's a help also for you! #Installation stack * PHP Environment * [PHP5](#php) * [PEAR](#pear) * [Phing](#phing) * General Environment * [git / github](#git) * [memcache](#memcache) @@ -15,10 +19,6 @@ I hope it's a help also for you! * [sqlite](#sqlite) * [gmagick](#gmagick) * [curl](#curl) * PHP QA Environment * [PHP Codesniffer](#php-codesniffer) * [PHPUnit](#phpunit) @@ -30,6 +30,29 @@ I hope it's a help also for you! * [Apache2 config example](#apache2-config-example) * [Nginx config example](#nginx-config-example) #Installation PHP Environment <a name="php"></a> ##PHP5 ```shell sudo apt-get install php5-cli php5-common php-apc php-pear php5-xdebug php5-curl php5 php5-dev sudo apt-get install php5-xsl sudo apt-get install php5-intl ``` <a name="pear"></a> ##PEAR ```shell sudo pear channel-update PEAR sudo pear upgrade PEAR ``` <a name="phing"></a> ##PHING ```shell sudo pear channel-discover pear.phing.info sudo pear install phing/phing ``` #Install General Environment <a name="git"></a> ##git @@ -100,29 +123,6 @@ extension=gmagick.so sudo apt-get install curl ``` #Installation PHP QA Environment <a name="php-codesniffer"></a> ##CodeSniffer -
DaRaFF revised this gist
Feb 20, 2013 . 1 changed file with 4 additions and 0 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -209,6 +209,10 @@ xdebug.remote_enable=On xdebug.remote_host=localhost xdebug.remote_port=9002 xdebug.remote_handler=dbgp xdebug.profiler_append=Off xdebug.profiler_enable=Off xdebug.profiler_enable_trigger=Off xdebug.profiler_output_dir="/tmp/kcachegrind" sudo service apache2 restart -
DaRaFF revised this gist
Dec 3, 2012 . 1 changed file with 1 addition and 0 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -158,6 +158,7 @@ sudo pear install pear.phpunit.de/PHPUnit_SkeletonGenerator ##php-cs-fixer ```shell sudo wget http://cs.sensiolabs.org/get/php-cs-fixer.phar -O /usr/local/bin/php-cs-fixer sudo chmod a+x /usr/local/bin/php-cs-fixer ``` <a name="phpstorm"></a> -
DaRaFF revised this gist
Dec 3, 2012 . 1 changed file with 7 additions and 0 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -22,6 +22,7 @@ I hope it's a help also for you! * PHP QA Environment * [PHP Codesniffer](#php-codesniffer) * [PHPUnit](#phpunit) * [PHP CS Fixer](#php-cs-fixer) * [PHPStorm IDE](#phpstorm) * Other * [php.ini settings](#php-ini) @@ -153,6 +154,12 @@ sudo pear config-set auto_discover 1 sudo pear install pear.phpunit.de/PHPUnit_SkeletonGenerator ``` <a name="php-cs-fixer"></a> ##php-cs-fixer ```shell sudo wget http://cs.sensiolabs.org/get/php-cs-fixer.phar -O /usr/local/bin/php-cs-fixer ``` <a name="phpstorm"></a> ##PHP Storm IDE * Download and install PHP Storm - http://www.jetbrains.com/phpstorm/ -
DaRaFF revised this gist
Nov 29, 2012 . 1 changed file with 72 additions and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -27,6 +27,7 @@ I hope it's a help also for you! * [php.ini settings](#php-ini) * [How to debug with XDebug and PHPStorm on Firefox and command line](#debugging-with-phpstorm) * [Apache2 config example](#apache2-config-example) * [Nginx config example](#nginx-config-example) #Install General Environment <a name="git"></a> @@ -245,7 +246,7 @@ source ~/.bashrc <a name="apache2-config-example"></a> #Apache2 config example (with Symfony2 framework) Assume you want to have your project in `/home/username/my_webside` ```shell @@ -273,4 +274,74 @@ sudo ln -s /etc/apache2/sites-available/www.my_webside.lo /etc/apache2/sites-ena #restart apache sudo /etc/init.d/apache2 restart ``` <a name="nginx-config-example"></a> #Nginx config example (with Symfony2 framework) Assume you want to have your project in `/home/username/my_webside` ```shell # Change user of Nginx # edit /etc/nginx/nginx.conf User <username> # Change user of php5-fpm # edit /etc/php5/fpm/pool.d/www.conf user = <username> group = <group of user> #Add entry to /etc/hosts 127.0.0.1 www.my_webside.lo #Create file /etc/nginx/sites-available/www.my_webside.lo #edit file (with example config) #www.my_webside.lo server { listen 80; server_name www.my_webside.lo; access_log /var/log/nginx/www.my_webside.lo.log; location / { root /home/username/my_webside/web; index index.html index.htm index.php app_dev.php; if ($request_filename !~ "\.(js|htc|ico|gif|jpg|png|css)$") { rewrite ^(.*) /app.php$1 last; } } location ~ \.php($|/) { set $script $uri; set $path_info ""; if ($uri ~ "^(.+\.php)(/.+)") { set $script $1; set $path_info $2; } fastcgi_pass 127.0.0.1:9009; include fastcgi_params; fastcgi_buffers 8 16k; fastcgi_buffer_size 32k; fastcgi_param SCRIPT_FILENAME /home/username/my_webside/web$script; fastcgi_param PATH_INFO $path_info; } } #create symbolic link to enable a site sudo ln -s /etc/nginx/sites-available/www.my_webside.lo /etc/nginx/sites-enabled/www.my_webside.lo #restart nginx sudo /etc/init.d/nginx restart sudo /etc/init.d/php5-fpm restart ``` -
DaRaFF revised this gist
Nov 6, 2012 . 1 changed file with 13 additions and 2 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -225,8 +225,19 @@ source ~/.bashrc * Set a breakpoint and run a console command ##PHPStorm Config ```shell #for PHPUnit Code Completion add PHPUnit path under file->settings->directories #Usually it’s stored in /usr/share/php/PHPUnit #for PHPUnit Skeleton Generator add phpunit-skelgen under file->settings->ProjectSettings->PHP->PHPUnit->SkeletonGenerator #Usually it's stored in /usr/bin/phpunit-skelgen ``` /usr/bin/phpunit-skelgen -
DaRaFF revised this gist
Nov 6, 2012 . 1 changed file with 4 additions and 0 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -146,6 +146,10 @@ sudo pear update-channels sudo pear upgrade-all sudo pear install --alldeps phpunit/PHPUnit sudo pear install --force --alldeps phpunit/PHPUnit #phpunit Skeleton Generator sudo pear config-set auto_discover 1 sudo pear install pear.phpunit.de/PHPUnit_SkeletonGenerator ``` <a name="phpstorm"></a> -
DaRaFF revised this gist
Nov 5, 2012 . 1 changed file with 7 additions and 0 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -14,6 +14,7 @@ I hope it's a help also for you! * [mysql](#mysql) * [sqlite](#sqlite) * [gmagick](#gmagick) * [curl](#curl) * PHP Environment * [PHP5](#php) * [PEAR](#pear) @@ -91,6 +92,12 @@ sudo pecl install gmagick-beta extension=gmagick.so ``` <a name="curl"></a> ##curl ```shell sudo apt-get install curl ``` #Installation PHP Environment <a name="php"></a> ##PHP5 -
DaRaFF renamed this gist
Nov 3, 2012 . 1 changed file with 0 additions and 0 deletions.There are no files selected for viewing
File renamed without changes. -
DaRaFF renamed this gist
Nov 3, 2012 . 1 changed file with 0 additions and 0 deletions.There are no files selected for viewing
File renamed without changes. -
DaRaFF revised this gist
Nov 3, 2012 . 1 changed file with 6 additions and 0 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,6 +1,7 @@ #Introduction If you're a php developer on ubuntu, there comes the time where you have to install/reinstall your system. I did it already a few times and i decided to write down the steps for a typical web developer stack with php. This is for a developer machine and not for live environment! I hope it's a help also for you! @@ -216,6 +217,11 @@ source ~/.bashrc * for PHPUnit Code Completion add PHPUnit path under file->settings-directories * Usually it’s stored in `/usr/share/php/PHPUnit` <a name="apache2-config-example"></a> #Apache2 config example Assume you want to have your project in `/home/username/my_webside` -
DaRaFF revised this gist
Nov 3, 2012 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -141,11 +141,11 @@ sudo pear install --force --alldeps phpunit/PHPUnit ``` <a name="phpstorm"></a> ##PHP Storm IDE * Download and install PHP Storm - http://www.jetbrains.com/phpstorm/ * Install Sun JDK - http://www.webupd8.org/2012/01/install-oracle-java-jdk-7-in-ubuntu-via.html * increase file watching limit (http://confluence.jetbrains.net/display/IDEADEV/Inotify+Watches+Limit) ```shell #add line to /etc/sysctl.conf fs.inotify.max_user_watches = 524288 -
DaRaFF revised this gist
Nov 3, 2012 . 1 changed file with 5 additions and 3 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -130,6 +130,7 @@ sudo pear install PHP_CodeSniffer #necessary if you already have installed phpunit via apt-get sudo apt-get remove phpunit #install newest version of phpunit sudo pear channel-discover pear.phpunit.de sudo pear channel-discover pear.symfony-project.com sudo pear channel-discover components.ez.no @@ -140,11 +141,12 @@ sudo pear install --force --alldeps phpunit/PHPUnit ``` <a name="phpstorm"></a> * Download and install PHP Storm - http://www.jetbrains.com/phpstorm/ * Install Sun JDK - http://www.webupd8.org/2012/01/install-oracle-java-jdk-7-in-ubuntu-via.html * increase file watching limit (http://confluence.jetbrains.net/display/IDEADEV/Inotify+Watches+Limit) ##PHP Storm IDE ```shell #add line to /etc/sysctl.conf fs.inotify.max_user_watches = 524288 -
DaRaFF revised this gist
Nov 3, 2012 . 1 changed file with 1 addition and 0 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -218,6 +218,7 @@ source ~/.bashrc #Apache2 config example Assume you want to have your project in `/home/username/my_webside` ```shell # Change user/group of Apache2 # edit /etc/apache2/apache2.conf User <username> -
DaRaFF revised this gist
Nov 3, 2012 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -115,7 +115,7 @@ sudo pear install phing/phing #Installation PHP QA Environment <a name="php-codesniffer"></a> ##CodeSniffer ```shell sudo pear install PHP_CodeSniffer ``` -
DaRaFF revised this gist
Nov 3, 2012 . 1 changed file with 2 additions and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -17,6 +17,7 @@ I hope it's a help also for you! * [PHP5](#php) * [PEAR](#pear) * [Phing](#phing) * PHP QA Environment * [PHP Codesniffer](#php-codesniffer) * [PHPUnit](#phpunit) * [PHPStorm IDE](#phpstorm) @@ -112,7 +113,7 @@ sudo pear channel-discover pear.phing.info sudo pear install phing/phing ``` #Installation PHP QA Environment <a name="php-codesniffer"></a> ##CodeSiffer ```shell
NewerOlder