PHPonTrax
[ class tree: PHPonTrax ] [ index: PHPonTrax ] [ all elements ]
Prev Next

Troubleshooting

Can't see index.html after installation

  1. Verify that Apache is actually running. On a Linux or Unix platform, Apache usually runs as httpd, so try:
    $ ps -ef|grep httpd
    The normal result is a list of several processes running httpd. If Apache is not running, start it. The usual way to start Apache is to run, as superuser:
    # apachectl start
  2. Find the Apache configuration file that is actually being used by the running Apache. The usual location is /etc/httpd/conf/httpd.conf but it may be elsewhere. Don't ignore the possibility that there is more than one httpd.conf on the system, in which case you need to figure out which is in use. Examine the value assigned to DocumentRoot in the configuration and verify that it is what you expected.
  3. Examine the Apache log files for clues. The location of the error log file is determined by the value assigned to ErrorLog in httpd.conf.
  4. Is Apache able to access index.html? Check the Unix permissions on that file and all the directories that contain it. The permissions must permit Apache to read all containing directories and the file.

Don't see 'Controller not found' after deleting index.html

Normal Trax processing of a request goes through the following steps:

  1. The browser sends Apache a URL which is in the area of the Trax application.
  2. Apache starts visiting the directories in that area, starting with the top (leftmost in the URL).
  3. In the top Trax application directory it finds file .htaccess which contains Apache configuration directives, which Apache interprets. The php_value directive sets the list of directories where Apache should look for PHP files. The following Rewrite... directives are the steps that Apache is to take in transforming the URL into a Trax command. Apache rewrites the URL, with the result that file dispatch.php is loaded and executed.
  4. dispatch.php loads the Trax application description file environment.php, which it finds in one of the directories listed in the php_value directive.
  5. With the Trax environment established, an instance of Dispatcher is created and its dispatch() method is invoked. This finds and calls the Trax action controller which interprets the URL.

Do the following to check the various places where the process can break down:

  1. Verify the name of the per-directory configuration file. File httpd.conf should contain a line like:
    AccessFileName .htaccess
    If AccessFileName is not .htaccess, change the name of file .htaccess to whatever the configuration wants.
  2. Verify that Apache is configured to follow commands from a .htaccess file in the Trax application directory. File httpd.conf should permit the access file (normally .htaccess unless changed) to override the configuration. The Apache directive is AllowOverride all and it must apply to the directory with the Trax application.
  3. Verify that dispatch.php is being loaded and executed by editting it to insert echo statements before and after require_once("environment.php");. The browser should display the output of both echo statements. If neither is displayed then there is a problem with the rewrite rules. If only the first echo is displayed then the require failed, meaning that mod_php couldn't find environment.php in the directories listed in the php_value statement.
  4. If you need to test the Apache Rewrite rules, the way to watch them operate is with the RewriteLog and RewriteLogLevel directives. You must add them to httpd.conf since Apache won't honor them if they appear in .htaccess. An example of what you might add is:
    RewriteLog /tmp/rewrite
    RewriteLogLevel 9
    This will write a description of each stage of rewrite processing to file /tmp/rewrite. The overhead is considerable so be sure to remove this from the configuration when you don't need it.
  5. If require_once("environment.php"); fails, check that the list of directories set by php_value in .htaccess matches the actual location of environment.php and that the permissions on the files and directories permit Apache to read them. Check the Apache error log for relevant messages. Since one of the functions of environment.php is to switch Apache error logging to the Trax log selected by the configured value of TRAX_MODE, check the Trax logs for relevant messages.




Prev Up Next
The Trax Naming Convention PHP On Trax Reference

Documentation generated on Thu, 04 May 2006 19:46:54 -0600 by phpDocumentor 1.3.0RC4