PHP installation/path issues
Moderator: General Moderators
PHP installation/path issues
I work for a medium sized company and we have decided to host our website internally from now on. The transfer is in the preliminary stages. Most of the site is static html but there are a couple of php pages. I've installed php 5.2.1 (ISAPI for IIS) and made sure php is registered within IIS but I'm having no luck loading the pages. Below is the error I'm receiving when trying to load...Main.php is the page I'm trying to load and I can post code if needed:
PHP Warning: include(/websites/html/frstcapital.com/WEB-INF/classes/phpmvc/utils/ClassPath.php) [function.include]: failed to open stream: No such file or directory in C:\Web\www.firstcapital.com\HTML\Main.php on line 55 PHP Warning: include() [function.include]: Failed opening '/websites/html/frstcapital.com/WEB-INF/classes/phpmvc/utils/ClassPath.php' for inclusion (include_path='.;C:\php5\pear') in C:\Web\www.firstcapital.com\HTML\Main.php on line 55 PHP Warning: include(/websites/html/frstcapital.com/WEB-INF/GlobalPaths.php) [function.include]: failed to open stream: No such file or directory in C:\Web\www.firstcapital.com\HTML\Main.php on line 58 PHP Warning: include() [function.include]: Failed opening '/websites/html/frstcapital.com/WEB-INF/GlobalPaths.php' for inclusion (include_path='.;C:\php5\pear') in C:\Web\www.firstcapital.com\HTML\Main.php on line 58 PHP Fatal error: Class 'GlobalPaths' not found in C:\Web\www.firstcapital.com\HTML\Main.php on line 59
Any help would be appreciated....Thank you!!
PHP Warning: include(/websites/html/frstcapital.com/WEB-INF/classes/phpmvc/utils/ClassPath.php) [function.include]: failed to open stream: No such file or directory in C:\Web\www.firstcapital.com\HTML\Main.php on line 55 PHP Warning: include() [function.include]: Failed opening '/websites/html/frstcapital.com/WEB-INF/classes/phpmvc/utils/ClassPath.php' for inclusion (include_path='.;C:\php5\pear') in C:\Web\www.firstcapital.com\HTML\Main.php on line 55 PHP Warning: include(/websites/html/frstcapital.com/WEB-INF/GlobalPaths.php) [function.include]: failed to open stream: No such file or directory in C:\Web\www.firstcapital.com\HTML\Main.php on line 58 PHP Warning: include() [function.include]: Failed opening '/websites/html/frstcapital.com/WEB-INF/GlobalPaths.php' for inclusion (include_path='.;C:\php5\pear') in C:\Web\www.firstcapital.com\HTML\Main.php on line 58 PHP Fatal error: Class 'GlobalPaths' not found in C:\Web\www.firstcapital.com\HTML\Main.php on line 59
Any help would be appreciated....Thank you!!
Main.php code
feyd | Please use
feyd | Please use
Code: Select all
,Code: Select all
and [syntax="..."] tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read: [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url] to learn how to do it too.[/color]Code: Select all
/* ---------- Application Paths ---------- */
// Set php.MVC library root directory
$appServerRootDir = '/websites/html/frstcapital.com'; // no trailing slash
// Set the application path
$moduleRootDir = '/websites/html/frstcapital.com'; // no trailing slash
/* ---------- Application Paths ---------- */
// Setup the application specific ActionDispatcher (RequestDispatcher)
$actionDispatcher = 'ActionDispatcher';
// Set the OS Type [Optional] [UNIX|WINDOWS|MAC] if we have
// trouble detecting the server OS type. Eg: path errors.
$osType = '';
// Relative path to the phpmvc configuration files
$configPath = './WEB-INF'; // no trailing slash
// Setup application class paths first
include $appServerRootDir.'/WEB-INF/classes/phpmvc/utils/ClassPath.php';
// Setup the app server paths
include $appServerRootDir.'/WEB-INF/GlobalPaths.php';
$globalPaths = GlobalPaths::getGlobalPaths();
$gPath = ClassPath::getClassPath($appServerRootDir, $globalPaths, $osType);
// Setup the module paths
// Note: In standalone modules, these paths will be in ModulePaths.php file
// Eg: "kooka/WEB-INF/ModulePaths.php"
$subAppPaths = array();
$subAppPaths[] = 'WEB-INF/classes/firstcapital';
$subAppPaths[] = 'WEB-INF/classes/firstcapital/action';
$subAppPaths[] = 'WEB-INF/classes/firstcapital/configRules';
$mPath = ClassPath::getClassPath($moduleRootDir, $subAppPaths, $osType);
$cPath = ClassPath::concatPaths($gPath, $mPath, $osType);
// And set the 'include_path' variables, as used by the file functions
ini_set('include_path', $cPath);
define('CLASSPATH', True);
$globalPrependFiles = $appServerRootDir.'/WEB-INF/globalPrepend.php';
include_once $globalPrependFiles;
include_once $actionDispatcher.'.php';
$start = FileUtils::utime();
// Startup configuration information for an php.MVC Web app
$appServerConfig = new AppServerConfig;
$appServerContext = new AppServerContext;
$appServerContext->setInitParameter('ACTION_DISPATCHER', $actionDispatcher);
$appServerConfig->setInitParameter('mapping', 'ActionMappingXXX');
$appServerConfig->setAppServerContext($appServerContext);
// Setup the php.MVC Web application controller
$actionServer = new ActionServer;
// Load Application Configuration
$oApplicationConfig = '';
$bootUtils = new BootUtils;
$oApplicationConfig = $bootUtils->loadAppConfig($actionServer, $appServerConfig,
$configPath);
if($oApplicationConfig == NULL) {
exit;
}
// Setup HTTP Request and add request attributes
$request = new HttpRequestBase;
$request->setAttribute(Action::getKey('APPLICATION_KEY'), $oApplicationConfig);
$request->setRequestURI($_SERVER['PHP_SELF']);
// Note: $_REQUEST was introduced in 4.1.0. There is no
// equivalent array in earlier versions.
$actionID = 'do';
if($_REQUEST != '') {
// Retrieve the 'action path'. Eg: index.php?do=[logonForm]
$doPath = BOOTUtils::getActionPath($_REQUEST, $actionID);
} else {
// kill !!!
}
// See: RequestProcessor->processPath(...) !!!
// <action path = "/stdLogon" ...> => "LogonAction"
// Note: We should catch any dodgy 'do=badHackerFile' path hacks
// in RequestProcessor->processMapping(...)
$request->setAttribute('ACTION_DO_PATH', $doPath);
// Setup HTTP Response and add request attributes
$response = new HttpResponseBase;
// Start processing the php.MVC Web application
// Note: Usage of depreciated $HTTP_POST_VARS type variables
// will be eventually replaced with the new PHP Superglobals.
// Eg: $_GET, $_POST, $_FILES. See: PHP manual- Predefined Variables
// Note: Consider ALL input data as tainted (insecure). All inputs should be
// checked for correctness and valid character/numeric ranges.
// Eg: "username "=> "^[a-z0-9]{8}$". See: /classes/DemoForm.php
if( isset($HTTP_SERVER_VARS['CMDLINE']) ) {
$request->setMethod('POST');
$actionServer->doPost($request, $response,
$HTTP_POST_VARS, $HTTP_POST_FILES);
} else {
if( $HTTP_SERVER_VARS['REQUEST_METHOD'] == 'GET' ) {
$actionServer->doGet($request, $response,
$HTTP_GET_VARS);
} elseif( $HTTP_SERVER_VARS['REQUEST_METHOD'] == 'POST' ) {
$actionServer->doPost($request, $response,
$HTTP_POST_VARS, $HTTP_POST_FILES);
}
}
$end = FileUtils::utime();
$run = $end - $start;
//echo substr($run, 0, 5) . " secs.";feyd | Please use
Code: Select all
,Code: Select all
and [syntax="..."] tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read: [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url] to learn how to do it too.[/color]Re: Main.php code
you have to provide the new valid paths here.Natas007 wrote:/* ---------- Application Paths ---------- */
// Set php.MVC library root directory
$appServerRootDir = '/websites/html/frstcapital.com'; // no trailing slash
// Set the application path
$moduleRootDir = '/websites/html/frstcapital.com'; // no trailing slash
/* ---------- Application Paths ---------- */
New Error
Thank you very much!! That definitely got me further. I'm now receiving the below error...the local valid path to the site is C:\Web\www.firstcapital.com\HTML.
tcapital.com\HTML\Main.php on line 80 PHP Fatal error: Class 'FileUtils' not found in C:\Web\www.firstcapital.com\HTML\Main.php on line 81
tcapital.com\HTML\Main.php on line 80 PHP Fatal error: Class 'FileUtils' not found in C:\Web\www.firstcapital.com\HTML\Main.php on line 81
- superdezign
- DevNet Master
- Posts: 4135
- Joined: Sat Jan 20, 2007 11:06 pm
File Path
FileUtils.php is in C:\Web\www.firstcapital.com\HTML\WEB-INF\classes\phpmvc\utils. I tried modifying the $appServerRootDir path but obviously that wasn't it because it didn't work. What do I need to modify? Thx again for all of you help.
- superdezign
- DevNet Master
- Posts: 4135
- Joined: Sat Jan 20, 2007 11:06 pm
Including FileUtils
This was the exact code that is currently functional on our production site that is hosted externally. I wouldn't think that I would have to modify the code...but if I need to include this class, where should I do it and what should the syntax look like? Thx.
- superdezign
- DevNet Master
- Posts: 4135
- Joined: Sat Jan 20, 2007 11:06 pm
Before use.
Code: Select all
include 'path/to/FileUtils.php';$Appserverconfig
This seems to be one thing after another. I've added the include statement for FileUtils.php and it doesn't seem to be erroring out on that line anymore but now its something else...of course. The current error is...
tcapital.com\HTML\Main.php on line 81 PHP Fatal error: Class 'AppServerConfig' not found in C:\Web\www.firstcapital.com\HTML\Main.php on line 86
Line 81...(this line is directly above where FileUtils is called)
include_once $actionDispatcher.'.php';
Line 86...
$appServerConfig = new AppServerConfig;
Any ideas??? Thx!
tcapital.com\HTML\Main.php on line 81 PHP Fatal error: Class 'AppServerConfig' not found in C:\Web\www.firstcapital.com\HTML\Main.php on line 86
Line 81...(this line is directly above where FileUtils is called)
include_once $actionDispatcher.'.php';
Line 86...
$appServerConfig = new AppServerConfig;
Any ideas??? Thx!
- superdezign
- DevNet Master
- Posts: 4135
- Joined: Sat Jan 20, 2007 11:06 pm