DooPHP IRC channel


doophp on iis5 doesn't work

This is for general DooPHP discussion. Ask your questions here.

doophp on iis5 doesn't work

Postby youreyes » Sat Nov 19, 2011 9:24 am

the very simple code,runn on apache is ok .
but on iis, ie show 404 error
i want to know why, and how to fix it.

thanks

------------------
iis5 with winxp
youreyes
 
Posts: 27
Joined: Thu Sep 03, 2009 3:00 am

Re: doophp on iis5 doesn't work

Postby roman » Sat Nov 19, 2011 8:37 pm

Does your IIS support what the supplied copy of .htaccess is designed for?
roman
 
Posts: 442
Joined: Sat Aug 01, 2009 8:31 pm

Re: doophp on iis5 doesn't work

Postby youreyes » Sun Nov 20, 2011 5:50 am

roman wrote:Does your IIS support what the supplied copy of .htaccess is designed for?

no, don't support

just iis only ,havn't install any other plug for iis
youreyes
 
Posts: 27
Joined: Thu Sep 03, 2009 3:00 am

Re: doophp on iis5 doesn't work

Postby RichardM » Sun Nov 20, 2011 12:29 pm

Have you even installed support for PHP in IIS ?

Also you'll need an equivalent of mod_rewrite for IIS installing and may need to write your own config file based on the htaccess ones.

Why not put it up on a machine running php/apache?


Richard
Note: code samples my not be 100% accurate.
RichardM
 
Posts: 1329
Joined: Sun Aug 30, 2009 6:03 pm
Location: Cumbria, UK

Re: doophp on iis5 doesn't work

Postby youreyes » Sun Nov 20, 2011 4:14 pm

RichardM wrote:Have you even installed support for PHP in IIS ?

Also you'll need an equivalent of mod_rewrite for IIS installing and may need to write your own config file based on the htaccess ones.

Why not put it up on a machine running php/apache?


Richard

php installed for iis already,and it work well.

some customers will run asp and php on iis
youreyes
 
Posts: 27
Joined: Thu Sep 03, 2009 3:00 am

Re: doophp on iis5 doesn't work

Postby RichardM » Sun Nov 20, 2011 4:34 pm

You'll need a replacement for htaccess / mod_rewrite to be running on iis. Can you access http://domain.com/index.php ? and are you on the latest revision of the code ?


Richard
Note: code samples my not be 100% accurate.
RichardM
 
Posts: 1329
Joined: Sun Aug 30, 2009 6:03 pm
Location: Cumbria, UK

Re: doophp on iis5 doesn't work

Postby youreyes » Sun Nov 20, 2011 11:34 pm

RichardM wrote:You'll need a replacement for htaccess / mod_rewrite to be running on iis. Can you access http://domain.com/index.php ? and are you on the latest revision of the code ?


Richard

some consumers use the web host (bluehost.com) and the host haven't installed the mod_rewrite form iis.

i use the last version of doophp from svn.
youreyes
 
Posts: 27
Joined: Thu Sep 03, 2009 3:00 am

Re: doophp on iis5 doesn't work

Postby RichardM » Sun Nov 20, 2011 11:54 pm

In that case you need another host. DooPHP has a few minimum requirements and this would be one of them.


Richard
Note: code samples my not be 100% accurate.
RichardM
 
Posts: 1329
Joined: Sun Aug 30, 2009 6:03 pm
Location: Cumbria, UK

Re: doophp on iis5 doesn't work

Postby youreyes » Mon Nov 21, 2011 12:36 pm

RichardM wrote:In that case you need another host. DooPHP has a few minimum requirements and this would be one of them.


Richard

anything is posbale. i have read the source code of doophp.
and i find the problem, just add 2 lines can fix my question.

config/common.conf.php
<?php
//for iis //by eyes
$r=isset($_GET['r'])?$_GET['r']:'/';
$_SERVER['REQUEST_URI']="/doophp$r";

/*
* Common configuration that can be used throughout the application
* Please refer to DooConfig class in the API doc for a complete list of configurations
* Access via Singleton, eg. Doo::conf()->BASE_PATH;
*/
error_reporting(E_ALL);
date_default_timezone_set('PRC');

/**
* for benchmark purpose, call Doo::benchmark() for time used.
*/
//$config['START_TIME'] = microtime(true);


//framework use, must defined, user full absolute path and end with / eg. /var/www/project/
$config['SITE_PATH'] = realpath(dirname(__FILE__).'/../../').'/';
//$config['PROTECTED_FOLDER'] = 'protected/';
$config['BASE_PATH'] = realpath(dirname(__FILE__).'/../../').'/dooframework/';

//for production mode use 'prod'
$config['APP_MODE'] = 'dev';

//just add under 3 lines
$config['SITE_PATH']=str_replace('\\','/',$config['SITE_PATH']);
$config['BASE_PATH']=str_replace('\\','/',$config['BASE_PATH']);
$_SERVER['DOCUMENT_ROOT']=str_replace('\\','/',$_SERVER['DOCUMENT_ROOT']);


//----------------- optional, if not defined, default settings are optimized for production mode ----------------
$config['SUBFOLDER'] = str_replace($_SERVER['DOCUMENT_ROOT'], '', str_replace('\\','/',$config['SITE_PATH']));
if(strpos($config['SUBFOLDER'], '/')!==0){
$config['SUBFOLDER'] = '/'.$config['SUBFOLDER'];
}

$config['APP_URL'] = 'http://'.$_SERVER['HTTP_HOST'].$config['SUBFOLDER'].'index.php';
$config['AUTOROUTE'] = true;
$config['DEBUG_ENABLED'] = TRUE;

//echo '<pre>';print_r($config);die;////////////////////eyes

//$config['TEMPLATE_COMPILE_ALWAYS'] = TRUE;

//register functions to be used with your template files
//$config['TEMPLATE_GLOBAL_TAGS'] = array('url', 'url2', 'time', 'isset', 'empty');

/**
* Path to store logs/profiles when using with the logger tool. This is needed for writing log files and using the log viewer tool
*/
//$config['LOG_PATH'] = '/var/logs/';


/**
* defined either Document or Route to be loaded/executed when requested page is not found
* A 404 route must be one of the routes defined in routes.conf.php (if autoroute on, make sure the controller and method exist)
* Error document must be more than 512 bytes as IE sees it as a normal 404 sent if < 512b
*/
//$config['ERROR_404_DOCUMENT'] = 'error.php';
//$config['ERROR_404_ROUTE'] = '/error';


/**
* Settings for memcache server connections, you don't have to set if using localhost only.
* host, port, persistent, weight
* $config['MEMCACHE'] = array(
* array('192.168.1.31', '11211', true, 40),
* array('192.168.1.23', '11211', true, 80)
* );
*/


/**
* you can include self defined config, retrieved via Doo::conf()->variable
* Use lower case for you own settings for future Compability with DooPHP
*/
//$config['pagesize'] = 10;



?>
youreyes
 
Posts: 27
Joined: Thu Sep 03, 2009 3:00 am

Re: doophp on iis5 doesn't work

Postby youreyes » Mon Nov 21, 2011 12:38 pm

thank you a lot
youreyes
 
Posts: 27
Joined: Thu Sep 03, 2009 3:00 am


Return to General Discussion

Who is online

Users browsing this forum: No registered users and 1 guest