php-general Digest 25 Nov 2004 14:33:56 -0000 Issue 3133

Topics (messages 202818 through 202851):

Re: SAFE MODE Restriction - mkdir()
        202818 by: SED
        202819 by: Michael Leung
        202822 by: SED
        202824 by: Michael Leung
        202840 by: Ford, Mike
        202841 by: Marek Kilimajer

Re: [firebird-php] auto increment last insert
        202820 by: Raditha Dissanayake
        202823 by: Greg Donald
        202825 by: Raditha Dissanayake
        202832 by: John Nichel
        202842 by: Greg Donald
        202851 by: Raditha Dissanayake

Re: Secure Password (MySQL) Storage
        202821 by: Raditha Dissanayake
        202835 by: Olaf van der Spek
        202837 by: Jason Wong

Re: RM file - play time
        202826 by: Rick Fletcher

Re: endless loop
        202827 by: Chris

Re: intalling pear:db
        202828 by: Merlin
        202829 by: Jason Wong
        202830 by: Merlin

Re: How to $_POST from a grid
        202831 by: Graham Cossey
        202834 by: Stuart Felenstein

Happy Thanksgiving
        202833 by: John Nichel
        202844 by: Greg Donald

Getting the contents of a file
        202836 by: Octavian Rasnita
        202838 by: Ford, Mike
        202839 by: Burhan Khalid

What else can cause "unexpected T_SL" error other than heredoc?
        202843 by: D. D. Brierton
        202845 by: Greg Donald
        202847 by: D. D. Brierton

Re: Regular Expression
        202846 by: Ing. Ivo F.A.C. Fokkema

How does one get into programming?
        202848 by: Ewald

Path to ImageMagick??
        202849 by: Aaron Wolski
        202850 by: Jon Hill

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 ---
It just seems not making sence. I have read the manual and it does not
explain this specially.

If the user owns this folder: "www\myfolders"

And runs a PHP-script in safe mode that creates the folder
"www\myfolders\who".

Who owns the "who" folder?

I assume the owner. If so, why can't the PHP-script create another folder
inside like "www\myfolders\who\this" like before?

If "the user of the php process" (UID) is the owner of the new folder, why
can't it create a folder inside its own folder? Is it because it's triggered
by a user different from the user of the PHP process?

Regards,
Summi

-----Original Message-----
From: Marek Kilimajer [mailto:[EMAIL PROTECTED] 
Sent: 25. nóvember 2004 01:13
To: SED
Cc: [EMAIL PROTECTED]
Subject: Re: [PHP] SAFE MODE Restriction - mkdir()

SED wrote:
> Then, shouldn't the owner be able to handle the new directory?
> 
> In my case, the owner creates the directory X but can't create a 
> subdirectory inside the directory X! nor save a file into it!
> 
> Can you explain that?
> 
> Is the PHP not always running as the same user? Or is it base on type 
> of the function?

Once again: the user of the php process is different from the owner of the
php script. And this is what matters.

The limitation is not at operating system level, but php willingly chooses
not to let you create the subdirectory (because safe mode is on)

> 
> Regards,
> Summi
>       
> 
> -----Original Message-----
> From: Marek Kilimajer [mailto:[EMAIL PROTECTED]
> Sent: 25. nóvember 2004 00:05
> To: SED
> Cc: [EMAIL PROTECTED]
> Subject: Re: [PHP] SAFE MODE Restriction - mkdir()
> 
> SED wrote:
> 
>>Hi,
>>
>>I have very wierd situation. The ISP is running in SAFE MODE.
>>
>>I use PHP to create a directory with mkdir("something", 0777), it 
>>works great!
>>
>>However, if I try to create a sub-directory (e.g. "something2") in the 
>>"something" directory, I get the following:
>>
>>Warning: SAFE MODE Restriction in effect. The script whose uid is 3703 
>>is not allowed to access "something" owned by uid 508 in 
>>/www/login/filer.php on line 287
>>
>>However, if I check the chmod of "something" directory it's 777.
>>
>>Why can't I use PHP-uid to do create or upload files to this "something"
>>directory, which PHP-uid itself created?
> 
> 
> Because SAFE MODE is on :-)
> 
> It's all in the manual. something is created by the server process so 
> it's also owned by server process. The script is owned by you and can 
> access only directories and files owned by you. You can try to change 
> the group
> (chgrp()) if safe_mode_gid is on, or use ftp functions to create the 
> directories.
> 

--- End Message ---
--- Begin Message ---
Hi sed,
   which version of PHP you using? may not be just Safe Mode. is it
the script working well before the safe mode is on?

yours,
Michael

--- End Message ---
--- Begin Message ---
The PHP Version is 4.2.3 on Apache/1.3.27.

I'm not the admin on this server. However, I have done this often on other
servers, both in safe mode and not, with good success. This is the first
time I try this on this server. The ISP-admin is also trying to solve this
but with not luck at this time. 

Regards,
Summi

-----Original Message-----
From: Michael Leung [mailto:[EMAIL PROTECTED] 
Sent: 25. nóvember 2004 03:21
To: SED
Cc: [EMAIL PROTECTED]
Subject: Re: [PHP] SAFE MODE Restriction - mkdir()

Hi sed,
   which version of PHP you using? may not be just Safe Mode. is it the
script working well before the safe mode is on?

yours,
Michael

--
PHP General Mailing List (http://www.php.net/) To unsubscribe, visit:
http://www.php.net/unsub.php

--- End Message ---
--- Begin Message ---
Hi,
   I have faced the same problem after the upgrade my server from php
4.2.2 to php 5.0.2. I tested mkdir() in both in safe_mode on and off.
I have posted this to php-bug.

yours,
Michael

--- End Message ---
--- Begin Message ---
To view the terms under which this email is distributed, please go to 
http://disclaimer.leedsmet.ac.uk/email.htm



On 25 November 2004 00:47, SED wrote:

> Then, shouldn't the owner be able to handle the new directory?
> 
> In my case, the owner creates the directory X but can't create a
> subdirectory inside the directory X! nor save a file into it!
> 
> Can you explain that?
> 
> Is the PHP not always running as the same user? Or is it base
> on type of the
> function?

It works like this:

(1) Script (owned by you) attempts to access original directory (owned by
you, presumably) -- ok.

(2) Script (owned by you, but running as Apache user) creates new
subdirectory (set to be owned by user *running* the script, i.e. Apache
user).

(3) Script (owned by you) attempts to access new subdirectory (owned by
Apache user) -- denied.

So, yes, you can create a directory which it is then impossible to access --
this is an unfortunate side-effect of safe mode when PHP runs as an Apache
module and hence as the Apache user.  This is why hosted services often use
chrooted jails with PHP as a CGI -- the individual copies of PHP then run
with the appropriate uids of the host usernames.

Cheers!

Mike

---------------------------------------------------------------------
Mike Ford,  Electronic Information Services Adviser,
Learning Support Services, Learning & Information Services,
JG125, James Graham Building, Leeds Metropolitan University,
Headingley Campus, LEEDS,  LS6 3QS,  United Kingdom
Email: [EMAIL PROTECTED]
Tel: +44 113 283 2600 extn 4730      Fax:  +44 113 283 3211 

--- End Message ---
--- Begin Message --- SED wrote:
It just seems not making sence. I have read the manual and it does not
explain this specially.

If the user owns this folder: "www\myfolders"

And runs a PHP-script in safe mode that creates the folder
"www\myfolders\who".

Who owns the "who" folder?

If the webserver is run under user nobody, then "who" folder is owned by user nobody. Only root can change owners so there's no way around it.



I assume the owner. If so, why can't the PHP-script create another folder inside like "www\myfolders\who\this" like before?

Webserver running under user nobody reads in your script owned by you. PHP has safe mode on, so everytime it creates a file or directory it checks if the owner of the parent directory is the same as the owner of the php script being executed. If it's not, it issues an "SAFE MODE Restriction in effect" error.




If "the user of the php process" (UID) is the owner of the new folder, why can't it create a folder inside its own folder? Is it because it's triggered by a user different from the user of the PHP process?


--- End Message ---
--- Begin Message ---
Johan van Zyl wrote:

Hi
Thx Helen for another non-hostile, and as usual, very informative response!
We newbie's are having a though time, well at least in THIS forum! At least
I am!
You (me) apparently have to RTFM or FO<g>


many people in this list believe that people who do not RTFM are lazy and do not deserve help.

--
Raditha Dissanayake.
------------------------------------------------------------------
http://www.radinks.com/print/card-designer/ | Card Designer Applet
http://www.radinks.com/upload/ | Drag and Drop Upload

--- End Message ---
--- Begin Message ---
On Thu, 25 Nov 2004 09:33:41 +0600, Raditha Dissanayake
<[EMAIL PROTECTED]> wrote:
> many people in this list believe that people who do not RTFM are lazy
> and do not deserve help.

That's because people who expect free help without RTFM are lazy and
do not deserve help.  How else do you plan to learn the language
without RTFM?  The knowledge isn't going to just jump into your head.


-- 
Greg Donald
Zend Certified Engineer
http://gdconsultants.com/
http://destiney.com/

"RTFM almost daily since 1998.."

--- End Message ---
--- Begin Message ---
Greg Donald wrote:

On Thu, 25 Nov 2004 09:33:41 +0600, Raditha Dissanayake
<[EMAIL PROTECTED]> wrote:


many people in this list believe that people who do not RTFM are lazy
and do not deserve help.



That's because people who expect free help without RTFM are lazy and do not deserve help. How else do you plan to learn the language without RTFM? The knowledge isn't going to just jump into your head.




hey greg, don't jump on me, i was trying to say the same thing you are saying perhaps i should have worded it better :-))




--
Raditha Dissanayake.
------------------------------------------------------------------
http://www.radinks.com/print/card-designer/ | Card Designer Applet
http://www.radinks.com/upload/ | Drag and Drop Upload

--- End Message ---
--- Begin Message --- Greg Donald wrote:
On Thu, 25 Nov 2004 09:33:41 +0600, Raditha Dissanayake
<[EMAIL PROTECTED]> wrote:

many people in this list believe that people who do not RTFM are lazy
and do not deserve help.


That's because people who expect free help without RTFM are lazy and
do not deserve help.  How else do you plan to learn the language
without RTFM?  The knowledge isn't going to just jump into your head.

Great, there goes my theory about sleeping with the PHP manual under my pillow. ;)


--
By-Tor.com
...it's all about the Rush
http://www.by-tor.com

--- End Message ---
--- Begin Message ---
On Thu, 25 Nov 2004 11:43:56 +0600, Raditha Dissanayake
<[EMAIL PROTECTED]> wrote:
> hey greg, don't jump on me, i was trying to say the same thing you are
> saying perhaps i should have worded it better :-))

Sorry if I offended you.


-- 
Greg Donald
Zend Certified Engineer
http://gdconsultants.com/
http://destiney.com/

--- End Message ---
--- Begin Message ---
John Nichel wrote:

Greg Donald wrote:

On Thu, 25 Nov 2004 09:33:41 +0600, Raditha Dissanayake
<[EMAIL PROTECTED]> wrote:

many people in this list believe that people who do not RTFM are lazy
and do not deserve help.



That's because people who expect free help without RTFM are lazy and do not deserve help. How else do you plan to learn the language without RTFM? The knowledge isn't going to just jump into your head.


Great, there goes my theory about sleeping with the PHP manual under my pillow. ;)

I was thinking of doing the same but gave up because i couldn't figure out a way of clicking on the links in my printed version of the manual.



--
Raditha Dissanayake.
------------------------------------------------------------------
http://www.radinks.com/print/card-designer/ | Card Designer Applet
http://www.radinks.com/upload/ | Drag and Drop Upload

--- End Message ---
--- Begin Message ---
Olaf van der Spek wrote:

Hi,

Is there a way to store MySQL (or other sensitive data) that will be passed to a library in such a way that scripts itself can't access this?
A per-vhost store would be ideal.


If not, would this be a good idea to implement?

Your question is not very clear but if you want to protect your data from prying eyes surely the best way would be to encrypt it? as for security on shared hosting enviorenments we have discussed that topic in the past a few times and the voices of authority strongly believe that it's not possible to completely prevent other users from taking a peek at your code. But then again you could use the turck or zend encoder on it.



--
Raditha Dissanayake.
------------------------------------------------------------------
http://www.radinks.com/print/card-designer/ | Card Designer Applet
http://www.radinks.com/upload/ | Drag and Drop Upload

--- End Message ---
--- Begin Message --- Raditha Dissanayake wrote:
Olaf van der Spek wrote:

Hi,

Is there a way to store MySQL (or other sensitive data) that will be

It should read MySQL passwords.

passed to a library in such a way that scripts itself can't access this?
A per-vhost store would be ideal.

If not, would this be a good idea to implement?

Your question is not very clear but if you want to protect your data from prying eyes surely the best way would be to encrypt it? as for security on shared hosting enviorenments we have discussed that topic in the past a few times and the voices of authority strongly believe that it's not possible to completely prevent other users from taking a peek at your code. But then again you could use the turck or zend encoder on it.

I'm more worried about the data (in MySQL), not the code.
By protecting the MySQL password from being read by scripts directly and only allowing access based on the current vhost, only this vhost can access it's own database and not somebody else.

--- End Message ---
--- Begin Message ---
On Thursday 25 November 2004 17:43, Olaf van der Spek wrote:

> I'm more worried about the data (in MySQL), not the code.
> By protecting the MySQL password from being read by scripts directly and
> only allowing access based on the current vhost, only this vhost can
> access it's own database and not somebody else.

Set default MySQL user and password in your virtual host container. Then 
connect to MySQL without specifying user and password.

-- 
Jason Wong -> Gremlins Associates -> www.gremlins.biz
Open Source Software Systems Integrators
* Web Design & Hosting * Internet & Intranet Applications Development *
------------------------------------------
Search the list archives before you post
http://marc.theaimsgroup.com/?l=php-general
------------------------------------------
/*
Spock: We suffered 23 casualties in that attack, Captain.
*/

--- End Message ---
--- Begin Message --- Alexander Kleshchevnikov wrote:
Can I get the information about paly time of the RM file by PHP?

IIRC, the getID3 library has support for reading RealAudio/Video. You can find it here: http://getid3.sourceforge.net/


--Rick
--- End Message ---
--- Begin Message --- By default, I believe, it stops executing when the user hits the stop button. You can control this with the ignore_user_abort function

http://www.php.net/ignore_user_abort

Chris

Dustin Krysak wrote:

Hi there....

I was making a script that had a loop, and ended up with a endless loop by accident. Now if that script is executed on the server - does the script die as soon as the browser is closed? Or does it keep running as a process on the server?

Thanks!

d


--- End Message ---
--- Begin Message --- Jeffery Fernandez wrote:
Merlin wrote:

Greg Beaver wrote:

Merlin wrote:

Hi there,

I am trying to get a class running which requires pear:DB.

I downloaded the package and executed:
# pear install DB-1.6.8.tgz
DB already installed




pear upgrade DB-1.6.8.tgz



Hi,pear list


I successfully upgraded with this command. However the system still says: Fatal error: Call to undefined function: fetchrow()

Is fetchrow a part from pear:db? And if so, why does it still not work? I have restarted the webserver.

Merlin

Make sure the pear libraries are within the include path of PHP. Open your php.ini and look for the "include_path" directive. Read more here: http://au.php.net/manual/en/ini.sect.path-directory.php#ini.include-path

cheers,
Jeffery
http://melbourne.ug.php.net

Hi,

that did not help. The pear manual says that this can be installed via command line, plus "pear list" tells me that the package is installed. However if I call phpinfo() there is no mentioning about pear in any way?! Do I have to enable it first anyhow?`

Thanx, Merlin
--- End Message ---
--- Begin Message ---
On Thursday 25 November 2004 15:56, Merlin wrote:

> >> I successfully upgraded with this command. However the system still
> >> says: Fatal error: Call to undefined function: fetchrow()

The error message will say which line caused the error. Examine that line and 
see how fetchrow() is being called. Is it called as part of an object's 
method? Is that object one of pear's?

> that did not help. The pear manual says that this can be installed via
> command line, plus "pear list" tells me that the package is installed.
> However if I call phpinfo() there is no mentioning about pear in any way?!
> Do I have to enable it first anyhow?`

If you have full error reporting enabled, then any errors in including the 
pear files will show. All the pear stuff are just files that you include. 
There is no setting as such to enable to disable pear.

-- 
Jason Wong -> Gremlins Associates -> www.gremlins.biz
Open Source Software Systems Integrators
* Web Design & Hosting * Internet & Intranet Applications Development *
------------------------------------------
Search the list archives before you post
http://marc.theaimsgroup.com/?l=php-general
------------------------------------------
/*
True leadership is the art of changing a group from what it is to what
it ought to be.
                -- Virginia Allan
*/

--- End Message ---
--- Begin Message ---
Hi Jason,

>All the pear stuff are just files that you include.

I do not understand?! How come the pear site provides a command line installer:
http://pear.php.net/manual/en/installation.cli.php

When I call "pear list" it tells me that pear:db is installed. I also tried to compile php '--with-PEAR', but it tells me nowhere in the phpinfo() that there is anything about pear.

So you say I have to copy the untared pear:db files to any directory and include them?

Thanx,

Merlin



Jason Wong wrote:
On Thursday 25 November 2004 15:56, Merlin wrote:


I successfully upgraded with this command. However the system still
says: Fatal error: Call to undefined function: fetchrow()


The error message will say which line caused the error. Examine that line and see how fetchrow() is being called. Is it called as part of an object's method? Is that object one of pear's?


that did not help. The pear manual says that this can be installed via
command line, plus "pear list" tells me that the package is installed.
However if I call phpinfo() there is no mentioning about pear in any way?!
Do I have to enable it first anyhow?`


If you have full error reporting enabled, then any errors in including the pear files will show. All the pear stuff are just files that you include. There is no setting as such to enable to disable pear.


--- End Message ---
--- Begin Message ---
[snip]
>
> I'm doing my development in Dreamweaver though the
> code is basic.  To get to the grid I'm passing over
> the userID  .  Then basic a select statement in the
> results grid with a while loop the returns all the
> records related to the userID.
>
> It's just odd - because in Dreamweaver I build the
> grid with one table row, place my echo fieldx in each
> cell, then create a "repeat region" around the row.
> The repeat region is the while loop.
>
> The behaviour though is different for whatever reason.
>   Using a link with GET (paramter in the URL) it
> distinguishes each primaryID correctly.  Yet with POST
> no. As Jason just posted, yes it has individual submit
> buttons, yet they solely return the last record.
[snip]

Hi Stuart

Have you looked at the HTML generated by your PHP code?
Using view source you'll see what values each of your 3 forms contains and
therefore what will be submitted in the POST. My guess from one of your
previous posts is that all 3 forms contain the same value in the (hidden) ID
field. You were getting the value from a class but did not appear to be
passing any kind of index to the class to determine which value to return.

HTH
Graham

--- End Message ---
--- Begin Message ---
--- Graham Cossey <[EMAIL PROTECTED]> wrote:

> Hi Stuart
> 
> Have you looked at the HTML generated by your PHP
> code?
> Using view source you'll see what values each of
> your 3 forms contains and
> therefore what will be submitted in the POST. My
> guess from one of your
> previous posts is that all 3 forms contain the same
> value in the (hidden) ID
> field. You were getting the value from a class but
> did not appear to be
> passing any kind of index to the class to determine
> which value to return.
> 
> HTH
> Graham
> 
Graham - hope your doing good!
It is 4:25am here but just fixed the problem. 
Solution - I created my standard repeat region around
all fields I want returned.  Within the repeat region
I put a form around the submit button and included the
hidden element as well in the form. So each record
returned has a seperate form around the button.  It
works! Records returned properly.

Stuart

--- End Message ---
--- Begin Message ---
Happy Turkey Day ladies and gents.

Disclaimer :
If you are not in the US, or do not celebrate Thanksgiving, you are still allowed to have a 'happy' day. ;)


--
By-Tor.com
...it's all about the Rush
http://www.by-tor.com

--- End Message ---
--- Begin Message ---
On Thu, 25 Nov 2004 04:25:10 -0500, John Nichel <[EMAIL PROTECTED]> wrote:
> Happy Turkey Day ladies and gents.

Same to you.


-- 
Greg Donald
Zend Certified Engineer
http://gdconsultants.com/
http://destiney.com/

--- End Message ---
--- Begin Message ---
Hi all,

I am trying to use the file() function, but without success.

Here is the code:
$url = "http://www.rasd.ro/Quotes/11-24-2004.txt";
$file = file($url);

And this is the error:
PHP Parse error:  syntax error, unexpected T_VARIABLE in [FILE] on line 13

The line 13 contains:

$file = file($url);

I get the content of $url in a more complex way, so I cannot put the url to
that file directly in the function file().

Why it is not possible to use a var in file()?

Thanks.

Teddy

--- End Message ---
--- Begin Message ---
To view the terms under which this email is distributed, please go to 
http://disclaimer.leedsmet.ac.uk/email.htm



On 25 November 2004 10:11, Octavian Rasnita wrote:

> Hi all,
> 
> I am trying to use the file() function, but without success.
> 
> Here is the code:
> $url = "http://www.rasd.ro/Quotes/11-24-2004.txt";

You have no semicolon on the end of the above line.

> $file = file($url);

So the $file at the beginning of this line is a parse error.
 
> And this is the error:
> PHP Parse error:  syntax error, unexpected T_VARIABLE in [FILE] on
> line 13 

PHP can only tell you the line on which it first detects an error (13, in
this case); the actual error may be on a previous line (12, in this case).

Cheers!

Mike

---------------------------------------------------------------------
Mike Ford,  Electronic Information Services Adviser,
Learning Support Services, Learning & Information Services,
JG125, James Graham Building, Leeds Metropolitan University,
Headingley Campus, LEEDS,  LS6 3QS,  United Kingdom
Email: [EMAIL PROTECTED]
Tel: +44 113 283 2600 extn 4730      Fax:  +44 113 283 3211 

--- End Message ---
--- Begin Message --- Octavian Rasnita wrote:
Hi all,

I am trying to use the file() function, but without success.

Here is the code:
$url = "http://www.rasd.ro/Quotes/11-24-2004.txt";
$file = file($url);

You are missing a ;

--- End Message ---
--- Begin Message ---
We've been getting the following error:

[error] PHP Parse error:  parse error, unexpected T_SL in
/foo/bar.php on line 136

(where foo and bar obviously are stand-ins for real values).

The weird thing is that the file generating the error, bar.php, DOESN'T
contain any heredoc quotations. bar.php was being called by another file,
let's call it baz.php with require_once, and baz.php was also calling
other files using require_once which DID include heredoc quotations, let's
call them heredoc1.php and heredoc2.php. I was able to determine that the
problem was indeed caused by bar.php, and not by anything in heredoc1.php
or heredoc2.php by testing in the following way:

Testing baz.php with the the following commented out:

require_once 'bar.php';
// require_once 'heredoc1.php';
// require_once 'heredoc2.php';

Then testing baz.php with the following commented out:

// require_once 'bar.php';
require_once 'heredoc1.php';
require_once 'heredoc2.php';

In the first test the "unexpected T_SL" error persisted, whereas in the
second it went away.

But, bar.php does NOT contain any heredoc quoted strings, nor does it
contain anywhere the strings "<<" or ">>". So what could be the cause of
the T_SL error?

This is PHP 4.3.8 on Linux kernel 2.4.20 and Apache 1.3.31.

TIA, Darren

-- 
======================================================================
D. D. Brierton            [EMAIL PROTECTED]           www.dzr-web.com
       Trying is the first step towards failure (Homer Simpson)
======================================================================

--- End Message ---
--- Begin Message ---
On Thu, 25 Nov 2004 12:17:01 +0000, D. D. Brierton <[EMAIL PROTECTED]> wrote:
> We've been getting the following error:
> 
> [error] PHP Parse error:  parse error, unexpected T_SL in
> /foo/bar.php on line 136

Can you post some of this code?  Are all your heredoc instances
completely left justified?

> (where foo and bar obviously are stand-ins for real values).
> 
> The weird thing is that the file generating the error, bar.php, DOESN'T
> contain any heredoc quotations. bar.php was being called by another file,
> let's call it baz.php with require_once, and baz.php was also calling
> other files using require_once which DID include heredoc quotations, let's
> call them heredoc1.php and heredoc2.php. I was able to determine that the
> problem was indeed caused by bar.php, and not by anything in heredoc1.php
> or heredoc2.php by testing in the following way:
> 
> Testing baz.php with the the following commented out:
> 
> require_once 'bar.php';
> // require_once 'heredoc1.php';
> // require_once 'heredoc2.php';
> 
> Then testing baz.php with the following commented out:
> 
> // require_once 'bar.php';
> require_once 'heredoc1.php';
> require_once 'heredoc2.php';
> 
> In the first test the "unexpected T_SL" error persisted, whereas in the
> second it went away.
> 
> But, bar.php does NOT contain any heredoc quoted strings, nor does it
> contain anywhere the strings "<<" or ">>". So what could be the cause of
> the T_SL error?

I dunno if that's just a typo in your post, but heredoc requires 3 <<<
or >>>, not two as you wrote.

Are you using any sort of PHP cache by chance?


-- 
Greg Donald
Zend Certified Engineer
http://gdconsultants.com/
http://destiney.com/

--- End Message ---
--- Begin Message ---
On Thu, 25 Nov 2004 06:26:22 -0600, Greg Donald wrote:

> On Thu, 25 Nov 2004 12:17:01 +0000, D. D. Brierton <[EMAIL PROTECTED]> wrote:
>> We've been getting the following error:
>> 
>> [error] PHP Parse error:  parse error, unexpected T_SL in
>> /foo/bar.php on line 136
> 
> Can you post some of this code?  Are all your heredoc instances
> completely left justified?

Okay, from "baz.php":

// load environment settings
require_once '../common/re5ult_settings.php'; // "bar.php" in my example
require_once '../common/re5ult_utils.php';    // "heredoc1.php"
require_once '../common/re5ult_xml.php';      // "heredoc2.php"

All of the heredoc instances were fine (as I think demonstrated by
commenting out the reference to re5ult_settings.php but NOT to the files
which contain the heredoc instances). Here is an example of one of them:

        echo <<<EOMSG

            </td>
        </tr>
    </table>
</body>
</html>
EOMSG;


>> But, bar.php does NOT contain any heredoc quoted strings, nor does it
>> contain anywhere the strings "<<" or ">>". So what could be the cause of
>> the T_SL error?
> 
> I dunno if that's just a typo in your post, but heredoc requires 3 <<<
> or >>>, not two as you wrote.

My point being that the file that certainly appears to be causing the
problem doesn't contain the string "<<" or ">>" and therefore nor does it
contain "<<<" or ">>>".

> Are you using any sort of PHP cache by chance?

No.

Thanks for helping.

Best, Darren

-- 
======================================================================
D. D. Brierton            [EMAIL PROTECTED]           www.dzr-web.com
       Trying is the first step towards failure (Homer Simpson)
======================================================================

--- End Message ---
--- Begin Message ---
On Wed, 24 Nov 2004 13:17:48 -0500, Ankur Os wrote:

> Hi,
> 
> This is quite simpal problem that i want to made regular expression which
> can read this kind of structure...
> 
> a,b,c
> 
> not like this
> 
> 1.  ,a,a,a
> 2.  a,,,aa,,
> 3.  a,a,a,,,
> 
> means simpal structure with comma (a,b,c...)
Hi,

Try this (untested) :

preg_match('/^([a-c],)*[a-c]$/', $input);

this will match characters a-c separated by commas. Replace 'a-c' by any
range of characters you like.

HTH,

Ivo

--- End Message ---
--- Begin Message ---
I've been in IT for about 12 years and is looking to change my direction to
programming. Can anyone direct me in the right direction as to what to study
or where to start???

Thx

Ewald

--- End Message ---
--- Begin Message ---
Hey all,

How can I find out the path ImageMagick on my server the php is running
on?

Need it for a software and I don't know where to look. Phpinfo() tells
me nothing.

Thanks!

Aaron

--- End Message ---
--- Begin Message ---
The two programmes you will probably use are called  'convert' and 'mogrify'
Usually found in /usr/bin if you are running Linux.

Cyril


On Thursday 25 November 2004 13:35, Aaron Wolski wrote:
> Hey all,
>
> How can I find out the path ImageMagick on my server the php is running
> on?
>
> Need it for a software and I don't know where to look. Phpinfo() tells
> me nothing.
>
> Thanks!
>
> Aaron

--- End Message ---

Reply via email to