Sleek Action Edit | SourceForge - PHP - Freshmeat - Gibson Research - Ubuntu Linux - Clusty Search - Babel Fish Translation - WordReference Dictionaries - Wiktionary - ASP
php.MVC, The Model View Controller Framework for PHP Web Applications
  Free OpenSource Downloads
The Model View Controller Framework for PHP Web Applications
 
spacer Features •  Demos •  Docs •  Design •  Download •  CVS •  Support •  Developers

spacer
Troubleshooting Guide to php.MVC

Contents:
  Introduction
  PHP.MVC Library Version
  PHP Version
  The Digester (XML Parser)
  Error Messages
  Tracing Errors
  File Path Errors
  Other Issues
  Resources

Introduction:

Please follow this guide when attempting to diagnose problems with the php.MVC Web application framework. Following this procedure should ensure that you get a quicker fix for your problem, and save valuable time for those trying to help you.

Before requesting help, check the forum and mailing list for posts of similar problems. The problem you are having may already have been answered, which could save you time.

Read any error messages that are displayed. The message is usually trying to tell you something about what is wrong, and can give you valuable clue in pin-pointing the error.

Please try to be a precise as possible when describing your problem. Give a brief description of your setup, and the contents of any error messages displayed.

PHP.MVC Library Version:

What version or CVS snapshot of the php.mvc library are you currently using? State this when asking for help.

Try using the latest version of the php.MVC library, available from the CVS directory. Your problem may have been fixed in the latest release. This will also assist with diagnosing any errors, thus providing a quicker fix to your problem.

PHP Version:

Some versions of PHP have trouble with session handling. Please state your current PHP version if the problem is session handling related.

You could also try a Google with any error messages displayed, if the problem appears to be related to PHP, or the Web server in general.

The Digester (XML Parser):

The Digester is a component of the php.MVC Web application framework that is responsible for processing the phpmvc-config.xml application XML files and serialising the configuration information. The Digester is only called when the phpmvc-config.xml for a particular application has been modified (touched). The application configuration data is stored in the phpmvc-config.data file within the WEB-INF directory.

Check if the phpmvc-config.data file is present in the WEB-INF directory. The phpmvc-config.data file should contain something like:
"O:17:"applicationconfig":14:{s:7:"classID";s:53:"ApplicationConfig: ..."

The phpmvc-config.data file must also be writable by the Web server.

Error Messages:

Check what the error message is actually saying. Does the error message give a clue to the problem?

Post the error message when asking for help.

Tracing Errors:

This section requires making some minor changes to the php.MVC library files. It would be a good idea to make a backup of the files listed below, so the original files can easily be restored when testing is complete.

Tracing the Digester class:

To trace errors relating to the Digester and XML processing, setup debugging in the Digester class constructor:
../phpmvc-base/WEB-INF/lib/digester/Digester.php

In the Digester constructor, set isDebugEnabled to True. Eg:

  function Digester($file=NULL) {
     ...
     $this->log->setLog('isDebugEnabled', True);
     ...
  }

The output viewed in a text editor should look something like:

  Debug: addRuleSet() with no namespace URI
  Debug: Start Element handler - Pushing body text ''
  Debug:  New match 'phpmvc-config'
  ...

Be sure to make a change (touch) to the phpmvc-config.xml file for your application, to trigger the Digester operation.

Look for any reported errors in this output, and send this debug dump if requested.

Tracing the ActionServer class:

The ActionServer class is part of the framework controller, and initially processes a HTTP request before passing the request on to the RequestProcessor class. The ActionServer also calls the Digester if the applications XML configuration file has changed and needs to be processed.

To trace errors relating to the ActionServer class, setup debugging in the ActionServer class constructor:
../phpmvc-base/WEB-INF/classes/phpmvc/action/ActionServer.php

In the ActionServer constructor, set debug and tracing to True . Eg:

   function ActionServer () {
      ...
      $this->log->setLog('isDebugEnabled', True);
      $this->log->setLog('isTraceEnabled', True);
      ...
   }

Be sure to make a change (touch) to the phpmvc-config.xml file for your application, to trigger the Digester operation.

Look for any reported errors in this output, and send this debug dump if requested.

Tracing the RequestProcessor class:

To trace errors relating to the RequestProcessor class, setup debugging in the RequestProcessor class constructor:
../phpmvc-base/WEB-INF/classes/phpmvc/action/RequestProcessor.php

In the RequestProcessor constructor, set debug and tracing to True Eg:

   function RequestProcessor () {
      ...
      $this->log->setLog('isDebugEnabled'	, True);
      $this->log->setLog('isTraceEnabled'	, True);
      ...
   }

Look for any reported errors in this output, and send this debug dump if requested.

No need to touch the phpmvc-config.xml here as the RequestProcessor class does not call the Digester.

File Path Errors:

Application Paths.  The php.MVC library and application paths are set in the application Main.php file. These are absolute paths to the php.MVC library directory and the application directory. They are not relative or Web paths. Also note that no trailing slash is required after the directory name . An example paths statement is shown below:

 /* ---------- Application Paths ---------- */
 // Set php.MVC library root directory
 $appServerRootDir	= 'D:/Dev/PHP/phpmvc-base';

 // Set the application path
 $moduleRootDir = 'C:/WWW/MyApplication';
/* ---------- Application Paths ---------- */

Operating System Type.  The framework attempts to automatically detect the type of server the php.MVC application is running on. This will usually be either Unix/Linux or Windows. The framework will then compile the necessary path environment string with the correct separator character for the host operating system used.

If you get file path errors, try setting the $osType variable in the applications Main.php file to the correct server OS. Eg:

   $osType = 'WINDOWS';
or
   $osType = 'UNIX'

You can also display the path string if necessary by accessing the $cPath variable in Main.php as follows:

   ...
   $cPath = ClassPath::concatPaths($gPath, $mPath, $osType);
   echo $cPath
   ...

Other Issues:

Have any other library files been changed? State this when asking for help.

Is the problem related to a third-party Plug-In, like Smarty or phpTAL. If so, it may be quicker to check the Web site and resources provided by the particular third-party vendor.

Resources:

php.MVC Forums
php.MVC Mailing Lists
php.MVC Bug Tracking System
php.MVC CVS snapshots
PHP Bugs



Document version: 12.January.2004
Copyright © 2004 John C. Wildenauer. All rights reserved.

Printable Page
spacer

SleeK Action Edit - Code Editor for Windows PHP Logo php.MVC Logo SourceForge
Copyright © 2006 John C. Wildenauer. All rights reserved.