Jump to content

Run Apache, Php and MySQL off a USB Stick: Difference between revisions

m
category & formatting
No edit summary
 
m (category & formatting)
Line 2: Line 2:


The answer to this problem is to run Apache, PHP and MySQL off a USB stick! Maintaining your site on a USB stick allows you to easily plug it into a lab machine and work away and then bring it home and continue right from where you left off.
The answer to this problem is to run Apache, PHP and MySQL off a USB stick! Maintaining your site on a USB stick allows you to easily plug it into a lab machine and work away and then bring it home and continue right from where you left off.
----


You will need to own a USB stick of at least 256MB (or 64MB if you can do without MySQL).
You will need to own a USB stick of at least 256MB (or 64MB if you can do without MySQL).




Download the lastest [http://httpd.apache.org/download.cgi Apache HTTP] (windows binary), [http://dev.mysql.com/downloads/  MySQL Community Server] (windows binary) and [http://www.php.net/downloads.php PHP] (windows zip) from their respective sites.
* Download the lastest [http://httpd.apache.org/download.cgi Apache HTTP] (windows binary), [http://dev.mysql.com/downloads/  MySQL Community Server] (windows binary) and [http://www.php.net/downloads.php PHP] (windows zip) from their respective sites.


Format your USB Stick.
* Format your USB Stick.


Create a directory called 'pdrive' in the usb root directory - this is where everything will be run from.
* Create a directory called 'pdrive' in the usb root directory - this is where everything will be run from.


Create a file called 'start.bat' in the usb root directory also, and have it contain the following :-
* Create a file called 'start.bat' in the usb root directory also, and have it contain the following :
   /pdrive/php-X.X.X/php.exe -c /pdrive/php.ini -f /pdrive/start.php
   /pdrive/php-X.X.X/php.exe -c /pdrive/php.ini -f /pdrive/start.php
Where php-X.X.X refers to the version of PHP you will install (i.e. php-5.2.2). Create a directory sess in pdrive/ for php to save the session data to.
Where php-X.X.X refers to the version of PHP you will install (i.e. php-5.2.2).  
* Create a directory sess in pdrive/ for php to save the session data to.
 
* Install Apache to pdrive/apache-X.X.X
* Download this [[USB Httpd.conf|httpd.conf]] to pdrive/apache-X.X.X/conf/
* Create a directory www in prdive/ - this will be where you develope your site.


Install Apache to pdrive/apache-X.X.X
* Install MySQL to pdrive/mysql
Download this [[USB Httpd.conf|httpd.conf]] to pdrive/apache-X.X.X/conf/
Create a directory www in prdive/ - this will be where you develope your site.


Install MySQL to pdrive/mysql
* Unzip PHP to pdrive/php-X.X.X
* Download this [[USB PHP.ini|PHP.ini]] to pdrive/


Unzip PHP to pdrive/php-X.X.X
* Finally download [[USB start.php|start.php]] to pdrive/ This will be run when you double click start.bat to start up the MySQL and Apache Services as well as open to your USB website, http://localhost:85.
Download this [[USB PHP.ini|PHP.ini]] to pdrive/


Finally download [[USB start.php|start.php]] to pdrive/ This will be run when you double click start.bat to start up the MySQL and Apache Services as well as open to your USB website, http://localhost:85.
* You will need to update the pages to download to reflect your versions of Apache and PHP.


You will need to update the pages to download to reflect your versions of Apache and PHP.
[[Category:HowTo]]