php-windows Digest 11 Jan 2008 06:04:12 -0000 Issue 3395
Topics (messages 28696 through 28704):
Re: Strange error in a very simple PHP file
28696 by: Jarrett Meyer
28697 by: Jacob Kruger
28698 by: Jarrett Meyer
28699 by: Jacob Kruger
PHP stopped working (possible inetpub folder problem?)
28700 by: Cloudbather
odbc_connect - urgent question
28701 by: Gustavo Ramalho
Re: [SUM] (sic) Changing/checking php.ini, and yet still the 'wrong'
include_path
28702 by: Greg Cocks
28703 by: php.jantir.net
Is there a hack or similar to get $_SERVER['PHP_SELF'] working under IIS?
28704 by: Greg Cocks
Administrivia:
To subscribe to the digest, e-mail:
[EMAIL PROTECTED]
To unsubscribe from the digest, e-mail:
[EMAIL PROTECTED]
To post to the list, e-mail:
[EMAIL PROTECTED]
----------------------------------------------------------------------
--- Begin Message ---
In my experience, it probably means that you're missing a closing brace
or the semicolon on the very last line of PHP code.
Jacob Kruger wrote:
In a very simple .php file where you're basically supposed to enter a
password to then log-on to the backend of a site, I'm getting a very
strange error:
Parse error: syntax error, unexpected $end in
C:\wamp\www\blindza\admin\index.php on line 43
Line 43 actually only has the text "</html>" on it (without the quotes).
<snip>
--
Jarrett M. T. Meyer
[EMAIL PROTECTED]
--- End Message ---
--- Begin Message ---
Well, 'looked' through the file, and haven't found anything like a missing ;
or ?> so I dunno.
Here's the full source thereof (maybe I'm actually 'missing' something due
to my screenreader not 'seeing' it or something - LOL!)
---start of source---
<?php session_start(); ?>
<!doctype html public "-//W3C//DTD HTML 4.0 //EN">
<html>
<head>
<title>Backend</title>
<?php
if (array_key_exists("btnGo", $_POST))
{
//echo "here you go...";
if ($_POST("admPass")=="adminpassword")
{
$_SESSION["admin"] = "true";
// echo "<script
type=\"text/javascript\">window.location=\"main.php\";</script>";
RedirectURL("main.php");
}
function RedirectURL($url)
{ // This calls javascript
$redir = "<script
language=\"javascript\">location.href=\"$url\"</script>\n";
return $redir;
}
?>
</head>
<body>
<form method="post" action="index.php" enctype="multipart/form-data"
name="form1">
<table align="center" border="0">
<tr>
<th align="center" colspan="2">
Log-in
</th>
</tr>
<tr>
<th align="right">Password</th>
<td><input type="password" name="admPass" size="50" /></td>
</tr>
<tr>
<th align="center" colspan="2"><input type="submit" name="btnGo"
value="Go" /></th>
</tr>
</table>
</form>
</body>
</html>
---end of source---
Like I said, the line it seems to reckon the problem is on is that very last
line, but it makes sense that the PHP renderer engine thinks it's just
missing something by then - who knows...
Thanks in advance
Jacob Kruger
Blind Biker
Skype: BlindZA
'...Fate had broken his body, but not his spirit...'
----- Original Message -----
From: "Jarrett Meyer" <[EMAIL PROTECTED]>
To: "Jacob Kruger" <[EMAIL PROTECTED]>
Cc: <[EMAIL PROTECTED]>
Sent: Thursday, January 10, 2008 4:10 PM
Subject: Re: [PHP-WIN] Strange error in a very simple PHP file
In my experience, it probably means that you're missing a closing brace or
the semicolon on the very last line of PHP code.
Jacob Kruger wrote:
In a very simple .php file where you're basically supposed to enter a
password to then log-on to the backend of a site, I'm getting a very
strange error:
Parse error: syntax error, unexpected $end in
C:\wamp\www\blindza\admin\index.php on line 43
Line 43 actually only has the text "</html>" on it (without the quotes).
<snip>
--
Jarrett M. T. Meyer
[EMAIL PROTECTED]
--
PHP Windows Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
--- End Message ---
--- Begin Message ---
No matching "}" for segment started on line 8...
Jacob Kruger wrote:
Well, 'looked' through the file, and haven't found anything like a
missing ; or ?> so I dunno.
Here's the full source thereof (maybe I'm actually 'missing' something
due to my screenreader not 'seeing' it or something - LOL!)
---start of source---
<?php session_start(); ?>
<!doctype html public "-//W3C//DTD HTML 4.0 //EN">
<html>
<head>
<title>Backend</title>
<?php
if (array_key_exists("btnGo", $_POST))
{
//echo "here you go...";
if ($_POST("admPass")=="adminpassword")
{
$_SESSION["admin"] = "true";
// echo "<script
type=\"text/javascript\">window.location=\"main.php\";</script>";
RedirectURL("main.php");
}
function RedirectURL($url)
{ // This calls javascript
$redir = "<script
language=\"javascript\">location.href=\"$url\"</script>\n";
return $redir;
}
?>
</head>
<body>
<form method="post" action="index.php" enctype="multipart/form-data"
name="form1">
<table align="center" border="0">
<tr>
<th align="center" colspan="2">
Log-in
</th>
</tr>
<tr>
<th align="right">Password</th>
<td><input type="password" name="admPass" size="50" /></td>
</tr>
<tr>
<th align="center" colspan="2"><input type="submit"
name="btnGo" value="Go" /></th>
</tr>
</table>
</form>
</body>
</html>
---end of source---
Like I said, the line it seems to reckon the problem is on is that
very last line, but it makes sense that the PHP renderer engine thinks
it's just missing something by then - who knows...
Thanks in advance
Jacob Kruger
Blind Biker
Skype: BlindZA
'...Fate had broken his body, but not his spirit...'
----- Original Message ----- From: "Jarrett Meyer" <[EMAIL PROTECTED]>
To: "Jacob Kruger" <[EMAIL PROTECTED]>
Cc: <[EMAIL PROTECTED]>
Sent: Thursday, January 10, 2008 4:10 PM
Subject: Re: [PHP-WIN] Strange error in a very simple PHP file
In my experience, it probably means that you're missing a closing
brace or the semicolon on the very last line of PHP code.
Jacob Kruger wrote:
In a very simple .php file where you're basically supposed to enter
a password to then log-on to the backend of a site, I'm getting a
very strange error:
Parse error: syntax error, unexpected $end in
C:\wamp\www\blindza\admin\index.php on line 43
Line 43 actually only has the text "</html>" on it (without the
quotes).
<snip>
--
Jarrett M. T. Meyer
[EMAIL PROTECTED]
--
PHP Windows Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
--
Jarrett M. T. Meyer
[EMAIL PROTECTED]
--- End Message ---
--- Begin Message ---
Ok.
Thanks.
Funny enough one of my first stuff-ups was that I didn't initially realise
that all three different types of parentheses, brackets, and braces were
being used since I was sort of listening for cues as opposed to listening to
specific details, and I suppose this is pretty much related.
I know that one or two of the editing programs I use can in fact sort of do
'matches' for opening and closeing braces {}, and maybe they can then also
double-check for ones that then don't having matching ones or something.
Anyway, thanks again - will fix it and go on from there...
Stay well
Jacob Kruger
Blind Biker
Skype: BlindZA
'...Fate had broken his body, but not his spirit...'
----- Original Message -----
From: "Jarrett Meyer" <
[EMAIL PROTECTED]>
To: "Jacob Kruger" <
[EMAIL PROTECTED]>
Cc: <
[EMAIL PROTECTED]>
Sent: Thursday, January 10, 2008 4:59 PM
Subject: Re: [PHP-WIN] Strange error in a very simple PHP file
No matching "}" for segment started on line 8...
Jacob Kruger wrote:
Well, 'looked' through the file, and haven't found anything like a
missing ; or ?> so I dunno.
Here's the full source thereof (maybe I'm actually 'missing' something
due to my screenreader not 'seeing' it or something - LOL!)
---start of source---
<?php session_start(); ?>
<!doctype html public "-//W3C//DTD HTML 4.0 //EN">
<html>
<head>
<title>Backend</title>
<?php
if (array_key_exists("btnGo", $_POST))
{
//echo "here you go...";
if ($_POST("admPass")=="adminpassword")
{
$_SESSION["admin"] = "true";
// echo "<script
type=\"text/javascript\">window.location=\"main.php\";</script>";
RedirectURL("main.php");
}
function RedirectURL($url)
{ // This calls javascript
$redir = "<script
language=\"javascript\">location.href=\"$url\"</script>\n";
return $redir;
}
?>
</head>
<body>
<form method="post" action="index.php" enctype="multipart/form-data"
name="form1">
<table align="center" border="0">
<tr>
<th align="center" colspan="2">
Log-in
</th>
</tr>
<tr>
<th align="right">Password</th>
<td><input type="password" name="admPass" size="50" /></td>
</tr>
<tr>
<th align="center" colspan="2"><input type="submit" name="btnGo"
value="Go" /></th>
</tr>
</table>
</form>
</body>
</html>
---end of source---
Like I said, the line it seems to reckon the problem is on is that very
last line, but it makes sense that the PHP renderer engine thinks it's
just missing something by then - who knows...
Thanks in advance
Jacob Kruger
Blind Biker
Skype: BlindZA
'...Fate had broken his body, but not his spirit...'
----- Original Message ----- From: "Jarrett Meyer" <
[EMAIL PROTECTED]>
To: "Jacob Kruger" <
[EMAIL PROTECTED]>
Cc: <
[EMAIL PROTECTED]>
Sent: Thursday, January 10, 2008 4:10 PM
Subject: Re: [PHP-WIN] Strange error in a very simple PHP file
In my experience, it probably means that you're missing a closing brace
or the semicolon on the very last line of PHP code.
Jacob Kruger wrote:
In a very simple .php file where you're basically supposed to enter a
password to then log-on to the backend of a site, I'm getting a very
strange error:
Parse error: syntax error, unexpected $end in
C:\wamp\www\blindza\admin\index.php on line 43
Line 43 actually only has the text "</html>" on it (without the
quotes).
<snip>
--
Jarrett M. T. Meyer
[EMAIL PROTECTED]
--
PHP Windows Mailing List (
http://www.php.net/)
To unsubscribe, visit:
http://www.php.net/unsub.php
--
Jarrett M. T. Meyer
[EMAIL PROTECTED]
--- End Message ---
--- Begin Message ---
This is a long shot, but...
I'm running PHP5.2.5 on Win2000 with IIS 5.0. PHP was working fine until
yesterday -- when I might have accidentally moved some files around in the
inetpub folder (b/c of a super-sensitive touchpad on my laptop :< I wasn't
swift enough to hit "undo" after that happened.
Now, when I try to open PHP files in Internet Explorer, I just see the PHP
code. I don't think I've messed up IIS -- it seems to be running fine -- and
I don't think I messed up the PHP525 or WINNT folders. I'm guessing this
problem might be because of the folders I possibly moved in inetpub --- but
maybe there's another reason that I'm not seeing? Any ideas?
Does anyone know how the inetpub folder is *supposed* to be organized?
Here's my current directory structure:
-Inetpub
|-AdminScripts
|-ftproot
|-iissamples
|-homepage
|-themes
|-sdk
|-admin
|-asp
|-applications
|-components
|-database
|-docs
|-interaction
|-simple
|-transactional
|-mailroot
|-Scripts
|-webpub
|-wwwroot
|-php_files
If this structure is messed up, can you tell me how I should move the
folders to get PHP working again? Alternatively, I'm thinking of just
re-installing PHP, and if that doesn't work, and possibly reformatting my
hard drive and reinstalling Win2000.
Thanks in advance for any help!
--- End Message ---
--- Begin Message ---
Hi, im in serious problems.
First sorry for bad english.
Im try to connect with many servers to take some information, but when one
of those is offline my script in php is fails and not proced.
Did have any way to configure te odbc_connect timeout?? its take to many
time to resolve take site is off or online. Im try to ping the server but
sometimes the server of internet is not same the sql server.
tks.
--- End Message ---
--- Begin Message ---
[RTFM! From the ‘install.txt’…]
15. How do I make the php.ini file available to PHP on windows?
There are several ways of doing this. If you are using Apache, read
their installation specific instructions (Apache 1, Apache 2),
otherwise you must set the PHPRC environment variable:
On Windows NT, 2000, XP and 2003:
* Go to Control Panel and open the System icon (Start -> Settings ->
Control Panel -> System, or just Start -> Control Panel -> System
for Windows XP/2003)
* Go to the Advanced tab
* Click on the 'Environment Variables' button
* Look into the 'System variables' pane
* Click on 'New' and enter 'PHPRC' as the variable name and the
directory where php.ini is located as the variable value (e.g.
C:\php)
* Press OK and restart your computer
Cheers:
GREG COCKS
gcocks |at| stoller.com
--------------------------------
________________________________________
From: Greg Cocks
Sent: Tuesday, January 08, 2008 12:34 PM
To: '[EMAIL PROTECTED]'
Subject: Changing/checking php.ini, and yet still the 'wrong' include_path
Hello,
I am doing some tidying, and so getting rid of the PHP that comes with
MapServer MS4W package – and replacing with a clean install of PHP5, moving my
root to the ‘default’ directory, etc, etc…
On a Windows XP ‘test server’ running IIS 5.1 (getting a ‘proof of concept’ up
for a client, 2003 + IIS 6 when they give me some $$ for a server! ☺ (and
IIS as that is the company ‘standard’… ☺ ))
I got everything running OK with PHP installed as C:\php\ using the MSI
installed and IIS CGI…
All the PHP code seems to work just nicely that I have started using… except
when I tried to get PEAR up and going…
Ran the go-pear.bat as am using some of these packages in the web/PHP pages
already written and in use… runs fine at the command line (list, install,
upgrade, etc) BUT…
When I go to a web page that worked fine previously, I get:
Fatal error: require_once() [function.require]: Failed opening required
'numbers/Roman.php' (include_path='.;C:\php5\pear') in
C:\Inetpub\wwwroot\standard_format_items\bottom_navigation_bar.php on line 21
As you can see the include path is wrong…
Looking at phpinfo.php, it and the extensions directory also show C:\php5\
instead of C:\php\
- C:\php\php.ini has the right include path
- I checked that the Windows PATH was C:\php\
- I had a look in the registry as per the manual install notes at php.net and
no sign of \php5\ (although the keys they mention are NOT there…)
- did a couple of restarts, in case it needed to ‘take’
- checked C:\windows\pear.ini
Where the heck is this erroneous C:\php5\ and .;C:\php5\pear values kept? And
how do I change them?
Thanks in advance…
(and I would rather not change the directory name to C:\php5\, with all that
entails! ☺ )
----------
Regards,
GREG COCKS
GIS Analyst V
gcocks |at| stoller.com
S. M. Stoller Corp
105 Technology Drive, Suite 190
Broomfield, CO 80021
www.stoller.com
303-546-4300
303-443-1408 fax
303-546-4422 direct
303-828-7576 cell
--- End Message ---
--- Begin Message ---
I ran into this as well when I recently set up PHP on IIS.
Adding the PHPRC environment variable as per this page is what solved it for
me.
http://www.php.net/manual/en/faq.installation.php#faq.installation.phprc
Reboot afterward
--- End Message ---
--- Begin Message ---
Hello,
*Is there a hack (?), a workaround or some alternative to get
$_SERVER['PHP_SELF'] working under IIS?*
I am new(ish) to PHP, IIS and web pages as a whole (!)
I was hoping to get the 'breadcrumbs' feature working...
And for a variety of reasons I am using IIS (currently v5.1 on some test
hardware running XP Pro, soon to be 6.x (?) on Server '03 when the client gets
me the dosh...)
Using PHP 5.2.5, if that matters...
Note that I am still using this stuff in a 'black box'-ish way, so feel free to
talk down to me! GRIN
For instance, I tried to use the approach at http://tinyurl.com/2zb4ck before I
gained enough knowledge to realise this solves a different (but similar) - it
seems - problem...
Thanks in advance...
----------
Regards,
GREG COCKS
GIS Analyst V
gcocks |at| stoller.com
S. M. Stoller Corp
105 Technology Drive, Suite 190
Broomfield, CO 80021
www.stoller.com
303-546-4300
303-443-1408 fax
303-546-4422 direct
303-828-7576 cell
--- End Message ---