logo
XAMPP Setup Notes (2014)

XAMPP Setup Notes (2014)

 

This page has been updated for my 2014 dev environments.

3 XAMPP Footprints

My approach was to have 3 environments to mimic larger enterprise strategies so I could have similar dev workflows as work.

  • xampp_dev
    • apache:81
    • mysql:3306
  • xampp_test
    • apache:82
    • mysql:(not used, will be pointing to dev db)
  • xampp_prod
    • apache:82
    • mysql: not used, will be pointing to live db

 

Variables Schema

For each xampp installation, I created a suite of variables so I'd have to scrub conf files only ONCE.

Define xampp_path D:/xampp_dev

Define htdocs_path P:/www/com/silosix/dev_2014

Define apache_port 81

XAMPP Installation

Install xampp 3 times.

Note: Probably would have been better to install once, then copy the other two AFTER I had introduced the variables, but I trashed an install on the first attempt so installed a second footprint so I could steal the working conf files back to the _dev footprint.

  1. D:\xampp_dev
  2. D:\xampp_test
  3. D:\xampp_prod

Preparing lines, then updating

SAVE OFF THE XAMPP DIR BEFORE CHANGES. I JUST ZIPPED THE FOLDER. THAT WAY, IF YOU DESTROY THINGS YOU CAN GET BACK. A SMARTER PERSON MIGHT CREATE A GIT REPO AND COMMIT THINGS, THEN CHANGE.

When scrubbing the conf file I first identified all the lines that needed changing with 

###--------------------------------------------------------

Then I commented the orginal line, copied and updated it with the variable placement

Define xampp_path D:/xampp_prod

Define htdocs_path P:/devl/www/com/silosix/prod_2014

Define apache_port 83

###---------------------------------------------------------------------------------------------------------------

#ServerRoot "D:/xampp_dev/apache"

ServerRoot "${xampp_path}/apache"

###---------------------------------------------------------------------------------------------------------------

 

httpd.conf and httpd-xampp are the two main files to update to get going. I used notepad++ to file in all files 'xampp_dev' and did search and replace with ${xampp_path}. I wiped non-critical lines from this example for brevity, your install/server needs might have more changes.



/apache/conf/httpd.conf

Define xampp_path D:/xampp_prod
Define htdocs_path P:/devl/www/com/silosix/prod_2014
Define apache_port 83
###--------------------------------------------------------------------------------------------------------------------
#ServerRoot "D:/xampp_dev/apache"
ServerRoot "${xampp_path}/apache"
###--------------------------------------------------------------------------------------------------------------------
Listen ${apache_port}
###--------------------------------------------------------------------------------------------------------------------
ServerName localhost:${apache_port}
###--------------------------------------------------------------------------------------------------------------------
DocumentRoot "${htdocs_path}"
###--------------------------------------------------------------------------------------------------------------------
#<Directory "D:/xampp_dev/htdocs">
<Directory "${htdocs_path}">
###--------------------------------------------------------------------------------------------------------------------
    ScriptAlias /cgi-bin/ "${xampp_path}/cgi-bin/"
<Directory "${xampp_path}/cgi-bin">

/apache/conf/extra/httpd-xampp.conf

Define xampp_path D:/xampp_dev
Define htdocs_path P:/devl/www/com/silosix/dev_2014
#
# XAMPP settings
#

<IfModule env_module>
    SetEnv MIBDIRS "${xampp_path}/php/extras/mibs"
    SetEnv MYSQL_HOME "\\xampp\\mysql\\bin"
    SetEnv OPENSSL_CONF "${xampp_path}/apache/bin/openssl.cnf"
    SetEnv PHP_PEAR_SYSCONF_DIR "\\xampp\\php"
    SetEnv PHPRC "\\xampp\\php"
    SetEnv TMP "\\xampp\\tmp"
</IfModule>

#
# PHP-Module setup
#
LoadFile "${xampp_path}/php/php5ts.dll"
LoadFile "${xampp_path}/php/libpq.dll"
LoadModule php5_module "${xampp_path}/php/php5apache2_4.dll"

<FilesMatch "\.php$">
    SetHandler application/x-httpd-php
</FilesMatch>
<FilesMatch "\.phps$">
    SetHandler application/x-httpd-php-source
</FilesMatch>

#
# PHP-CGI setup
#
#<FilesMatch "\.php$">
#    SetHandler application/x-httpd-php-cgi
#</FilesMatch>
#<IfModule actions_module>
#    Action application/x-httpd-php-cgi "/php-cgi/php-cgi.exe"
#</IfModule>


<IfModule php5_module>
    PHPINIDir "${xampp_path}/php"
</IfModule>

<IfModule mime_module>
    AddType text/html .php .phps
</IfModule>

ScriptAlias /php-cgi/ "${xampp_path}/php/"
<Directory "${xampp_path}/php">
    AllowOverride None
    Options None
    Require all denied
    <Files "php-cgi.exe">
          Require all granted
    </Files>
</Directory>

<Directory "${xampp_path}/cgi-bin">
    <FilesMatch "\.php$">
        SetHandler cgi-script
    </FilesMatch>
    <FilesMatch "\.phps$">
        SetHandler None
    </FilesMatch>
</Directory>

###--------------------------------------------------------------------------------------------------------------------
#<Directory "${xampp_path}/htdocs/xampp">
#<Directory "P:/DEVL/www/com/silosix/prod_2014/xampp">
<Directory "${xampp_path}/xampp">
###--------------------------------------------------------------------------------------------------------------------
    <IfModule php5_module>
     <Files "status.php">
     php_admin_flag safe_mode off
     </Files>
    </IfModule>
    AllowOverride AuthConfig
</Directory>


<IfModule alias_module>
###--------------------------------------------------------------------------------------------------------------------
    Alias /security "${xampp_path}/security/htdocs/"
###--------------------------------------------------------------------------------------------------------------------
###-------------------------------------------------------------------------------------------------------------------- 
    <Directory "${xampp_path}/security/htdocs">
###-------------------------------------------------------------------------------------------------------------------- 
        <IfModule php5_module>
     <Files "xamppsecurity.php">
     php_admin_flag safe_mode off
     </Files>
        </IfModule>
        AllowOverride AuthConfig
        Require all granted
   </Directory>

    Alias /licenses "${xampp_path}/licenses/"
    <Directory "${xampp_path}/licenses">
        Options +Indexes
        <IfModule autoindex_color_module>
            DirectoryIndexTextColor  "#000000"
            DirectoryIndexBGColor "#f8e8a0"
            DirectoryIndexLinkColor "#bb3902"
            DirectoryIndexVLinkColor "#bb3902"
            DirectoryIndexALinkColor "#bb3902"
        </IfModule>
        Require all granted
   </Directory>

    Alias /phpmyadmin "${xampp_path}/phpMyAdmin/"
    <Directory "${xampp_path}/phpMyAdmin">
        AllowOverride AuthConfig
        Require all granted
    </Directory>

    Alias /webalizer "${xampp_path}/webalizer/"
    <Directory "${xampp_path}/webalizer">
        <IfModule php5_module>
     <Files "webalizer.php">
     php_admin_flag safe_mode off
     </Files>
        </IfModule>
        AllowOverride AuthConfig
        Require all granted
    </Directory>
</IfModule>

#
# New XAMPP security concept
#
<LocationMatch "^/(?i:(?:xampp|security|licenses|phpmyadmin|webalizer|server-status|server-info))">
        Require local
ErrorDocument 403 /error/XAMPP_FORBIDDEN.html.var
</LocationMatch>
 

PHP

PHP.ini - error_reporting

NOT here..

; error_reporting
; Default Value: E_ALL & ~E_NOTICE & ~E_STRICT & ~E_DEPRECATED
; Development Value: E_ALL
; Production Value: E_ALL & ~E_DEPRECATED & ~E_STRICT

HERE...

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; Error handling and logging ;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

; This directive informs PHP of which errors, warnings and notices you would like
; it to take action for. The recommended way of setting values for this
...
...
; Common Values:
; E_ALL (Show all errors, warnings and notices including coding standards.)
; E_ALL & ~E_NOTICE (Show all errors, except for notices)
; E_ALL & ~E_NOTICE & ~E_STRICT (Show all errors, except for notices and coding standards warnings.)
; E_COMPILE_ERROR|E_RECOVERABLE_ERROR|E_ERROR|E_CORE_ERROR (Show only errors)
; Default Value: E_ALL & ~E_NOTICE & ~E_STRICT & ~E_DEPRECATED
; Development Value: E_ALL
; Production Value: E_ALL & ~E_DEPRECATED & ~E_STRICT
; http://php.net/error-reporting
; ORIGINAL VALUE
;error_reporting = E_ALL & ~E_NOTICE & ~E_STRICT & ~E_DEPRECATED

error_reporting = E_ALL | E_STRICT

PHP - display_errors to "display_errors = Off"

; Possible Values:
; Off = Do not display any errors
; stderr = Display errors to STDERR (affects only CGI/CLI binaries!)
; On or stdout = Display errors to STDOUT
; Default Value: On
; Development Value: On
; Production Value: Off
; http://php.net/display-errors
;display_errors = On
display_errors = Off

FileZilla FTP Server

FileZilla FTP Setup

FileZillaFTP

FileZillaFTP

FileZillaFTP

FileZillaFTP

FileZillaFTP

FileZillaFTP

 

FileZillaFTP

 

 

©2013 SiloSix.com All Rights Reserved