Skip to content

Commit

Permalink
Enable xdebug for local debugging.
Browse files Browse the repository at this point in the history
  • Loading branch information
Firesphere committed Mar 7, 2015
1 parent 7bd0054 commit 417b580
Show file tree
Hide file tree
Showing 6 changed files with 27 additions and 3 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ Edit the `Vagrantfile` to enable or disable install scripts as they are required
|php-56.sh |PHP |5.6.x|Webtatic EL6|Installs PHP 5.6, restarts Apache
|mariadb.sh |MariaDB |5.5|MariaDB.org|Installs MariaDB, opens port 3306, imports dumps in /vagrant/database
|php-mcrypt.sh |PHP Mcrypt extension|-|EPEL|Installs Mcrypt. Only needed for PHP 5.3.x as 5.5 has it built-in.
|xdebug.sh |Xdebug extension |-|PECL|Install Xdebug extension for debugging purposes.
|ntp.sh |ntp|-|CentOS|Installs NTP which handles time management
|node.sh |NodeJS|-|Fedora EPEL|Installs the NodeJS language and its package manager, NPM
|bower.sh |Bower|-|NPM|Installs the Bower dependency manager
Expand Down
1 change: 1 addition & 0 deletions Vagrantfile
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ Vagrant.configure("2") do |config|
config.vm.provision :shell, :path => "scripts/apache.sh"
config.vm.provision :shell, :path => "scripts/mariadb.sh"
#config.vm.provision :shell, :path => "scripts/php-mcrypt.sh"
#config.vm.provision :shell, :path => "scripts/xdebug.sh"
#config.vm.provision :shell, :path => "scripts/ntp.sh"
#config.vm.provision :shell, :path => "scripts/node.sh"
#config.vm.provision :shell, :path => "scripts/bower.sh"
Expand Down
2 changes: 1 addition & 1 deletion scripts/php-54.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
PHP_NAME="php"

# declare the php modules we want
MODULES=(common mysql gd mbstring xml tidy)
MODULES=(common mysql gd mbstring xml tidy pear devel)

echo "Installing PHP and common modules"
yum install -y $PHP_NAME ${MODULES[@]/#/$PHP_NAME-}
Expand Down
2 changes: 1 addition & 1 deletion scripts/php-55.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
PHP_NAME="php55w"

# declare the php modules we want
MODULES=(common mysql gd mbstring xml tidy)
MODULES=(common mysql gd mbstring xml tidy pear devel)

/vagrant/scripts/epel.sh

Expand Down
2 changes: 1 addition & 1 deletion scripts/php-56.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
PHP_NAME="php56w"

# declare the php modules we want
MODULES=(common mysql gd mbstring xml tidy)
MODULES=(common mysql gd mbstring xml tidy pear devel)

/vagrant/scripts/epel.sh

Expand Down
22 changes: 22 additions & 0 deletions scripts/xdebug.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
#!/bin/bash

# For running PHPStorm or IntelliJ, follow these steps:
# 1. Go to Settings => Language & Frameworks => PHP => Servers
# 2. Add you Vagrant server with the correct port.
# 3. Check the pathmapping checkbox and set your root of the project to /vagrant and the www directory to /www/directory
# 4. Apply and close settings
# 5. Go to Run => Edit configurations
# 6. Add a new PHP Web Application with the server you just added. The rest is trivial and free to fill.
# 7. Aply and done!

echo "Install Xdebug"
yum install -y gcc gcc-c++ autoconf automake

pecl install Xdebug
if [ ! -f /etc/php.d/xdebug.ini ]
then
echo "[xdebug]
zend_extension=\"/usr/lib64/php/modules/xdebug.so\"
xdebug.remote_connect_back = 1
xdebug.remote_enable = 1" > /etc/php.d/xdebug.ini
fi

0 comments on commit 417b580

Please sign in to comment.