Setting up Trax with EasyPHP (Windows)

I soon found out that EasyPHP isn’t so easy to get PEAR and commandline php working. Hopefully this will help people that are unfortunately stuck on windoze and want to use EasyPHP to develop their php apps. I may look at WAMP next to see if it’s any easier. As well will make a guide for setting up OSX and Trax which is what I use personally.

1. Download and install easyPHP 5.3.0.

2. EasyPHP’s version of PEAR is jacked. To fix it, right click here on go-pear.phar and save it to “C:\Program Files\EasyPHP5.3.0\php\PEAR”. Just overwriting the existing go-pear.phar file.

3.  Open a command window (Start -> Run, type cmd) and

cd C:\Program Files\EasyPHP5.3.0\php

4. Install PEAR. In command window type go-pear.

5.   Now edit C:\Program Files\EasyPHP5.3.0\php\pear.bat file and change the line toward the top from this:

IF "%PHP_PEAR_PHP_BIN%"=="" SET "PHP_PEAR_PHP_BIN=.\php.exe"

to this:

IF "%PHP_PEAR_PHP_BIN%"=="" SET "PHP_PEAR_PHP_BIN=C:\Program Files\EasyPHP5.3.0\php\php.exe"

6. Edit your system path so you can run commandline commands without putting in the complete path.

  • Right-click My Computer and click Properties.
  • In the System Properties window, click on the Advanced tab.
  • In the Advanced section, click the Environment Variables button.
  • In the Environment Variables window, highlight the Path variable in the Systems Variable section and click the Edit button. Add the path “;C:\Program Files\EasyPHP5.3.0\php” to the end of whatever is in there already but be sure to have the “;” separating the addition from the old path.

7.  Open a new command window.  If you type in now “php -v“  you should show the version of php you are running in my case 5.3.0. Next type “pear” and you should see a bunch of output about pear options.

Now everything up until this point was just to get pear and php installed working from the commandline. :(  Now lets install PHP on Trax.

8.  Install Trax.  Instructions can be found here.  Following the instructions on that page you do the following commands.

First add the Trax channel server:

pear channel-discover pear.phpontrax.com

Next install Trax:

pear install trax/PHPonTrax

Lastly if you are using mysql you can run:

pear install -f pear/MDB2#mysql

9. Last thing to do is make a trax.bat file and place it in the folder C:\Program Files\EasyPHP5.3.0\php. The file contents will be the one line below.

php "C:\Program Files\EasyPHP5.3.0\php\PEAR\PHPonTrax\trax.php" %1

To verify your Trax install is working at the commandline type

trax -v

You should see the output Trax 0.16.0

If you want to start making an app cd into the directory for your project and type:

trax .

This will generate all the basic files needed to make a new Trax app.

That’s it now you should be ready to start making Trax apps!

Edit: Also need to change some Apache/PHP configurations. Right click the e icon next to the time. Then goto Configuration => Apache. This will open up the httpd.conf file for Apache.

1. uncomment the line:

LoadModule rewrite_module modules/mod_rewrite.so

2. Scroll to the bottom and add the following replacing “c:/projects/traxtest/public” with the correct path to your trax public folder for your app:

NameVirtualHost *:80
<VirtualHost *:80>
    DocumentRoot "c:/projects/traxtest/public"
    ServerName localhost
	<Directory "c:/projects/traxtest/public">
		Options FollowSymLinks Indexes
		AllowOverride All
		Order deny,allow
		Allow from 127.0.0.1
		deny from all
	</Directory>
</VirtualHost>

Next edit PHP Configuration. Right click the e and go to Configuration => PHP. Change the following lines:

short_open_tag = On
error_reporting = E_ALL & ~E_NOTICE & ~E_DEPRECATED

In Trax Edit two files.
1. In your app’s public folder the .htaccess file make sure that the seperator on the include_path is a “;” and not a “:” and that the path to your app’s config folder is correct.

php_value include_path .;C:\projects\traxtest\config

2. In your app’s config folder edit the environment.php file and uncomment and set the PHP_LIB_ROOT constant.

define("PHP_LIB_ROOT",    "C:\Program Files\EasyPHP5.3.0\php\PEAR");

Then in your browser you should be able to goto the url: http://localhost and see the default trax welcome page.

Comments are closed.