[Xitami] Php problems
MRJ
mrj at 10e12.com
Fri Aug 15 08:59:08 CEST 2008
The problem is common.
You must change the default page section as well.
the proper config is as follows
Skip all they say about PHP-CGI
Use this to make it work..
In defaults.cfg add the following...
[Filter]
#
-------------------------------------------------------------------------
.php="c:/php/php.exe"
[Mime]
php=application/x-httpd-php
Change your default index settings as follows...
default1=index.php
default2=default.php
default3=index.htm
default4=default.htm
default5=index.html
default6=default.html
default7=404.htm
In default setup of PHP 5 on Windows you should be aware of the following.
a) $_POST[$VarName] WILL NOT WORK
$_SESSION[$xVar] WILL NOT WORK
they are turned off by default and should be so as well since they pose
security risks.
b) The workaround for this is included below
(©2008 to myself)
<?php
/*
==========================================================================
A replacement function for $_REQUEST as this does not work at all out of
the box on XITAMI web server. I was seriously thinking of making it a
somwhat permanent fixture in my PHP arsenal by adding a $_ infront of
the name but that would not fly to well in some languages I bet.
==========================================================================
Safer Networks Ltd. (c) 2008 - Major Thanks to
lphuberdeau at phpquebec dot org (21-Aug-2004 05:55)
for the entry that resolved all my problems in PHP man. 5 chm version
suggestion in Chapter 4. Dealing with XForms
==========================================================================
*/
function EX_REQUEST($var){
If ($_SERVER['REQUEST_METHOD']=="GET"){
$qstr = $_SERVER['QUERY_STRING'];
If ($qstr!=""){
parse_str($qstr, $element);
$val = $element[$var];
}else{
$val = NULL;
}
unset($qstr); //free mem or data you dont want GC to keep
}else if($_SERVER['REQUEST_METHOD']=="POST"){
$fp = fopen( "php://stdin", "r" );
$data = "";
while(!feof( $fp ) ){
$data .= fgets( $fp );
}
fclose( $fp );
if($data!=""){
parse_str($data, $element); //printf($data);
$val = $element[$var];
unset($data); //free mem or data you dont want GC to keep
}else{
$val = NULL;
}
}else{
// DOES NOT SUPPORT PUT OR HEAD AT THIS TIME.
// and we cannot return Empty or 0 when nothing was recieved.
$val = NULL;
}
return $val;
}
?>
SEE SOURCE FOR INFORMATION<HR>
<?php
// HOW TO USE THE FUNCTION --------------------
/* REMOVE LINE 46 AND 66 TO SEE WORKING EXAMPLE
<html><body>
<form method=post action="x.php"
enctype='application/x-www-form-urlencoded'>
<input type=hidden value=4 name='p'><input type=submit value='post
it'></form><br>
<form method=get action="x.php" enctype='application/x-www-form-urlencoded'>
<input type=hidden value=4 name='p'><input type=submit value='get
it'></form><br>
<?php
echo "The variable p is detected as having Value: " . ParseReq('p') .
"<br>";
?>
</body></html>
*/
?>
---
Russel Olinger wrote:
> From a command prompt have you verify the php script works properly?
>
> When installing PHP there is an option to select which webserver you
> are installing for and it lists Xitami - make certain you select
> that. But what Brian stated below should be sufficient to get things
> working.
>
>
> ----- Original Message -----
> *From:* Donna Kordell <mailto:DKordell at msn.com>
> *To:* Xitami Users General Discussion
> <mailto:xitami at lists.xitami.org>
> *Sent:* Thursday, August 14, 2008 7:46 PM
> *Subject:* Re: [Xitami] Php problems
>
> I tried everything you said and I still see nothing in the
> browser. I used the php installer to install php. Should I go back
> and do it manually?
>
> ----- Original Message -----
> *From:* Brian Kowald <mailto:bkowald at synergybroadcast.com>
> *To:* Xitami Users General Discussion
> <mailto:xitami at lists.xitami.org>
> *Sent:* Thursday, August 14, 2008 9:34 PM
> *Subject:* Re: [Xitami] Php problems
>
> Donna,
>
> You should have a php.ini in your php folder.
> Did you copy "php.ini-recomended" to "php.ini" ?
>
> In xitami add this line in xitami.cfg or defaults.cfg under
> the [Filters] section
> For php 5:
> .php = "C:\\php\\php-cgi.exe"
> for php 4:
> .php = "C:\\php\\php.exe"
> You must set this in php.ini to get output back through the
> server to the browser:
> cgi.force_redirect = 0
> make this file and try to access it though a browser:
> Quick test file:
> <?php
> phpinfo();
> ?>
> Look at cgierr.log in c:\xitami for errors.
>
> That should give you some stuff to get going,
> Brian
>
>
>
>
>
> -----Original Message-----
> *From:* Donna Kordell [mailto:DKordell at msn.com]
> *Sent:* Thursday, August 14, 2008 10:14 PM
> *To:* xitami at lists.xitami.org
> *Subject:* [Xitami] Php problems
>
> Hello,
>
> I am new here and have very little clue what I am doing. I
> am basically just trying to get PHP to work on my home
> computer. I tried unsuccessfully to download apache.
> Having no other places to turn to, I found xitami. I
> followed the instruction in the FAQ to install php and
> they worked, sort of. The code printed out fine in DOS but
> still wouldn't function in a regular browser window. All
> the php tags were completely ignored.
>
> Please, I have no idea what I'm doing here. Any advice
> would be helpful. Thanks in advance.
>
>
> --
> Xitami Users Mailing List -- For Xitami support
> To unsubscribe: http://lists.xitami.org/mailman/listinfo/xitami
>
> ------------------------------------------------------------------------
>
> --
> Xitami Users Mailing List -- For Xitami support
> To unsubscribe: http://lists.xitami.org/mailman/listinfo/xitami
>
> ------------------------------------------------------------------------
>
>
> --
> Xitami Users Mailing List -- For Xitami support
> To unsubscribe: http://lists.xitami.org/mailman/listinfo/xitami
--
---------------------------------------------------------------------
Contact Details;
Within the United Kingdom;
Phone: 020 7724 5943
Mob: 079 6445 0998
International Callers;
Phone: +44 207 724 5943
Mob: +44 796 445 0998
You can also reach us on Skype, user ID: mrj10e12
DISCLAIMER===========================================================
The information contained in this communication is confidential
and may be legally privileged. It is intended solely for the
use of the individual or entity to whom it is addressed and
any others authorized to receive it. If you are not the intended
recipient, you are hereby notified that any disclosure, copying,
distribution or taking of any action in reliance on the contents
of this information is strictly prohibited. If you received this
communication in error, please immediately notify the sender
by return message and delete this communication and any copies
thereof, including any electronically saved copies in your systems.
NOTHING DISCLOSED BY E-MAIL, CHAT, SKYPE MESSAGE OR OTHER
COMMUNICATION SHOULD AT ANY TIME BE CONSTRUED OR INTERPRETED AS
LEGAL, INVESTMENT OR OTHER FINANCIAL ADVICE. IT IS IMPERATIVE
THAT YOU, THE RECIPIENT CONTACT, SEEK ADVICE, FROM A FULLY LICENSED
AND QUALIFIED FINANCIAL MARKET SPECIALIST BEFORE MAKING ANY DECISION
IN REGARDS TO INVESTMENT, FUNDING, LOANS, MORTGAGE OR OTHER SERVICES
AS REQUIRED FROM TIME TO TIME AND AT EACH SUCH TIME.
10e12 (Trillion) Ltd. is registered in
the United Kingdom, company #06331971.
FSA Reg. No 300699 CCLic. Reg. 530996
Also ask us about Mortgage solutions
in cooperation with S.G.Mortgages
=====================================================================
More information about the Xitami
mailing list