php-general Digest 9 Apr 2013 22:57:57 -0000 Issue 8188

Topics (messages 320800 through 320814):

Re: JPGraph new GanttBar ... bar caption on left, right side
        320800 by: Stuart Dallas

Lasting syntax error when there's none
        320801 by: frzng.me.com
        320802 by: Stephen
        320806 by: Marco Behnke
        320814 by: Filip Zrůst

htaccess question
        320803 by: Al
        320804 by: Daniel Brown

Commands which call exec() or shell_exec() ??
        320805 by: Ken Kixmoeller
        320807 by: Daniel Brown
        320808 by: Matijn Woudt
        320809 by: Ken Kixmoeller
        320810 by: Ken Kixmoeller
        320811 by: Ken Kixmoeller
        320812 by: El Ale...
        320813 by: Ken Kixmoeller

Administrivia:

To subscribe to the digest, e-mail:
        php-general-digest-subscr...@lists.php.net

To unsubscribe from the digest, e-mail:
        php-general-digest-unsubscr...@lists.php.net

To post to the list, e-mail:
        php-gene...@lists.php.net


----------------------------------------------------------------------
--- Begin Message ---
On 9 Apr 2013, at 11:23, "Meli Marco" <marco.m...@gknsintermetals.com> wrote:

> Hello,
> I would like to know how to print captions (normally used for percentage
> completion) on the left (start date) and right (end date) side of the
> bar, instead just on the right.
> Below the method for bar creation: 
> $planbar = new GanttBar ($c,'', $aData[PLANSTART][$y],
> $aData[PLANENDE][$y], ( chr(32).$aData[PLANSTART][$y].' -
> '.$aData[PLANENDE][$y] ) );
> Thanks.
> Marco.

This is a mailing list for PHP, not things written using PHP. You want a 
mailing list for JPGraph.

https://groups.google.com/forum/?hl=en-GB#!forum/jpgraph

Would you email the Oxford English Dictionary for help with using the English 
language?

-Stuart

-- 
Stuart Dallas
3ft9 Ltd
http://3ft9.com/

--- End Message ---
--- Begin Message ---
Hi everyone,

I have some weird problem with PHP compiler or something of this sort of 
things. We have some PHP files which are generated during the first request to 
the site. These files are normally executed via PHP then. For some reason PHP 
thinks that they contain syntax errors (verified using HTTP request, or `php 
-l`). I've found out it is extremely easy to resolve this issue manually when 
developing - simply renaming or touching that file resolves the issue. So, 
apparently those generated PHP files don't contain any syntax error. However, 
PHP thinks they do even across different SAPIs (CLI and FPM). Since fixing the 
issue in this manner doesn't seam reasonable even by some script on production, 
I'd like to know whether do you have any suggestion what settings to tweak or 
what might be the problem.

Here is some information about the environment (feel free to ask for more):
- PHP version: 5.3.10-1ubuntu3.6
- SAPI: FPM and CLI
- OS: Ubuntu 12.04
- Software: Ubuntu packages only (updated)
- HTTP request handling: nginx load balancer → PHP FPM daemon
- Machine: VMware Fusion (managed by Vagrant) hosted on OS X 10.8.3


Thanks,
-- 
frzng


--- End Message ---
--- Begin Message ---
You first step is to check the log files.

No matter how sure we are that there is no syntax error, always start with the logs.

It could be a file permission problem.

Stephen

On 13-04-09 11:00 AM, fr...@me.com wrote:
Hi everyone,

I have some weird problem with PHP compiler or something of this sort of things. We have some PHP files which are generated during the first request to the site. These files are normally executed via PHP then. For some reason PHP thinks that they contain syntax errors (verified using HTTP request, or `php -l`). I've found out it is extremely easy to resolve this issue manually when developing - simply renaming or touching that file resolves the issue. So, apparently those generated PHP files don't contain any syntax error. However, PHP thinks they do even across different SAPIs (CLI and FPM). Since fixing the issue in this manner doesn't seam reasonable even by some script on production, I'd like to know whether do you have any suggestion what settings to tweak or what might be the problem.

Here is some information about the environment (feel free to ask for more):
- PHP version: 5.3.10-1ubuntu3.6
- SAPI: FPM and CLI
- OS: Ubuntu 12.04
- Software: Ubuntu packages only (updated)
- HTTP request handling: nginx load balancer ? PHP FPM daemon
- Machine: VMware Fusion (managed by Vagrant) hosted on OS X 10.8.3


Thanks,




--
Stephen


--- End Message ---
--- Begin Message ---


Am 09.04.2013 17:00, schrieb fr...@me.com:
Hi everyone,

I have some weird problem with PHP compiler or something of this sort of 
things. We have some PHP files which are generated during the first request to 
the site. These files are normally executed via PHP then. For some reason PHP 
thinks that they contain syntax errors (verified using HTTP request, or `php 
-l`). I've found out it is extremely easy to resolve this issue manually when 
developing - simply renaming or touching that file resolves the issue. So, 
apparently those generated PHP files don't contain any syntax error. However, 
PHP thinks they do even across different SAPIs (CLI and FPM). Since fixing the 
issue in this manner doesn't seam reasonable even by some script on production, 
I'd like to know whether do you have any suggestion what settings to tweak or 
what might be the problem.


If touching resolves the error, maybe it is some kind of bytecode cache.
Do you use APC or something like that?

Touch the file after creating it
http://www.php.net/touch


Here is some information about the environment (feel free to ask for more):
- PHP version: 5.3.10-1ubuntu3.6
- SAPI: FPM and CLI
- OS: Ubuntu 12.04
- Software: Ubuntu packages only (updated)
- HTTP request handling: nginx load balancer → PHP FPM daemon
- Machine: VMware Fusion (managed by Vagrant) hosted on OS X 10.8.3


Thanks,


--
Marco Behnke
Dipl. Informatiker (FH), SAE Audio Engineer
Zend Certified Engineer PHP 5.3

Tel.: 0174 / 9722336
e-Mail: ma...@behnke.biz

Softwaretechnik Behnke
Heinrich-Heine-Str. 7D
21218 Seevetal

http://www.behnke.biz

Attachment: smime.p7s
Description: S/MIME Kryptografische Unterschrift


--- End Message ---
--- Begin Message ---
Hi Stephen,

I looked there before but I’ve increased debug level after you suggestion and 
there’s still nothing helpful I guess. But just to be sure:

Reverse proxy (“load balancer”):
- error log: nothing
- access log:
> 192.168.60.2 - - [09/Apr/2013:15:25:08 −0700] "GET /offer/create HTTP/1.1" 
> 500 42008 "http://localhost:8080/need/create"; "Mozilla/5.0 (Macintosh; Intel 
> Mac OS X 10_8_3) AppleWebKit/536.28.10 (KHTML, like Gecko) Version/6.0.3 
> Safari/536.28.10"

FPM pool:
- error log:
> [09-Apr-2013 22:25:08 UTC] PHP Parse error:  syntax error, unexpected $end in 
> /mnt/hgfs/vagrant-root/temp/cache/_Nette.FileTemplate/_Offer.create.latte-76106eddfc5f39910a042247bcba6d4f.php
>  on line 191

- access log:
> 127.0.0.1 -  09/Apr/2013:22:25:08 +0000 “GET /index.php” 200

I’m not sure why FPM access log reports status code 200 but this value might 
mean something else.

As you can see, there’s really not much in the logs. AFAIK permissions are 
fine, otherwise applying `touch` on those files wouldn’t resolve a thing. 
Timezones are also somewhat messed up, but that’s just a configuration issue I 
guess.

I’ll try running everything on near production system instead of Vagrant which 
may solve the issue. But I would like know the mechanics behind this issue 
anyway.

I’m still playing with the idea that application framework we use is behind 
that, but I see no reason why and why it affects different SAPIs. I also don’t 
get why touching resolves the problem, because it means some caching is in 
play. But where can it be configured? Or, is it some OS specific trickery? 
Don’t know yet…


Best,
-- 
frzng

On Apr 9, 2013, at 5:10 PM, Stephen <stephe...@rogers.com> wrote:

> You first step is to check the log files.
> 
> No matter how sure we are that there is no syntax error, always start with 
> the logs.
> 
> It could be a file permission problem.
> 
> Stephen
> 
> On 13-04-09 11:00 AM, fr...@me.com wrote:
>> Hi everyone,
>> 
>> I have some weird problem with PHP compiler or something of this sort of 
>> things. We have some PHP files which are generated during the first request 
>> to the site. These files are normally executed via PHP then. For some reason 
>> PHP thinks that they contain syntax errors (verified using HTTP request, or 
>> `php -l`). I've found out it is extremely easy to resolve this issue 
>> manually when developing - simply renaming or touching that file resolves 
>> the issue. So, apparently those generated PHP files don't contain any syntax 
>> error. However, PHP thinks they do even across different SAPIs (CLI and 
>> FPM). Since fixing the issue in this manner doesn't seam reasonable even by 
>> some script on production, I'd like to know whether do you have any 
>> suggestion what settings to tweak or what might be the problem.
>> 
>> Here is some information about the environment (feel free to ask for more):
>> - PHP version: 5.3.10-1ubuntu3.6
>> - SAPI: FPM and CLI
>> - OS: Ubuntu 12.04
>> - Software: Ubuntu packages only (updated)
>> - HTTP request handling: nginx load balancer → PHP FPM daemon
>> - Machine: VMware Fusion (managed by Vagrant) hosted on OS X 10.8.3
>> 
>> 
>> Thanks,
> 
> 
> -- 
> Stephen
> 


--- End Message ---
--- Begin Message ---
I know it's not a php question, but I can't readily find the answer elsewhere.

I want to make this directive universal. Put htaccess file on any host in any 
folder.

This works
RewriteEngine On

RewriteCond %{SERVER_PORT} !=443

RewriteRule ^(.*)$ https://www.foo.org/bar/$1 [R=301,L]  #Here the foo.org and 
/bar must be specified

I want what is in effect

RewriteRule ^(.*)$ https://{host_name}/{directory}/$1 [R=301,L]

I can easily do this with php regex capturing the (host and dir) and then rewriting the text string; but the Apache directives are not obvious.



--- End Message ---
--- Begin Message ---
On Tue, Apr 9, 2013 at 2:07 PM, Al <n...@ridersite.org> wrote:
> I know it's not a php question, but I can't readily find the answer
> elsewhere.
>
> I want to make this directive universal. Put htaccess file on any host in
> any folder.
>
> This works
> RewriteEngine On
>
> RewriteCond %{SERVER_PORT} !=443
>
> RewriteRule ^(.*)$ https://www.foo.org/bar/$1 [R=301,L]  #Here the foo.org
> and /bar must be specified
>
> I want what is in effect
>
> RewriteRule ^(.*)$ https://{host_name}/{directory}/$1 [R=301,L]
>
> I can easily do this with php regex capturing the (host and dir) and then
> rewriting the text string; but the Apache directives are not obvious.

    You were on the right track:

    RewriteRule ^ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]


--
</Daniel P. Brown>
Network Infrastructure Manager
http://www.php.net/

--- End Message ---
--- Begin Message ---
Hi -- -

Strange problem. One of my applications was just moved to a new server. The
new server has php configured to blacklist some functions (using
"disable_functions="). One of the "banned" functions is exec().

The error log is reporting "shell_exec() has been disabled for security
reasons"  --- but exec() or shell_exec() are not in my code *anywhere*. The
program and line number being reported makes absolutely no sense.

Are there other php commands that really call exec() or shell_exec() ???
Any clues how this could happen? Fixes (other than un-blacklisting the
command, of course)?

Many thanks,

Ken

--- End Message ---
--- Begin Message ---
On Tue, Apr 9, 2013 at 3:11 PM, Ken Kixmoeller <phph...@comcast.net> wrote:
> Hi -- -
>
> Strange problem. One of my applications was just moved to a new server. The
> new server has php configured to blacklist some functions (using
> "disable_functions="). One of the "banned" functions is exec().
>
> The error log is reporting "shell_exec() has been disabled for security
> reasons"  --- but exec() or shell_exec() are not in my code *anywhere*. The
> program and line number being reported makes absolutely no sense.
>
> Are there other php commands that really call exec() or shell_exec() ???
> Any clues how this could happen? Fixes (other than un-blacklisting the
> command, of course)?
>
> Many thanks,
>
> Ken

    If you're positive you aren't executing any command line code
(backticks, passthru(), et cetera), then check to see if arbitrary
code is somehow being attempted via your scripts.

--
</Daniel P. Brown>
Network Infrastructure Manager
http://www.php.net/

--- End Message ---
--- Begin Message ---
On Tue, Apr 9, 2013 at 9:11 PM, Ken Kixmoeller <phph...@comcast.net> wrote:

> Hi -- -
>
> Strange problem. One of my applications was just moved to a new server. The
> new server has php configured to blacklist some functions (using
> "disable_functions="). One of the "banned" functions is exec().
>
> The error log is reporting "shell_exec() has been disabled for security
> reasons"  --- but exec() or shell_exec() are not in my code *anywhere*. The
> program and line number being reported makes absolutely no sense.
>
> Are there other php commands that really call exec() or shell_exec() ???
> Any clues how this could happen? Fixes (other than un-blacklisting the
> command, of course)?
>
> Many thanks,
>
> Ken
>

The back tick(`) operator is also used for that same purpose. Maybe that's
in your code?

- Matijn

--- End Message ---
--- Begin Message ---
Thanks, Daniel - --

I do use passthru() -- in an entirely different part of the application (a
place where it runs a mysqldump to do a manual backup). Of course, I have
millions of backticks delimiting SQL fields and tables.

The error log is reporting specifically shell_exec(). Would a stray
backtick call that error?


On Tue, Apr 9, 2013 at 2:39 PM, Daniel Brown <danbr...@php.net> wrote:

> On Tue, Apr 9, 2013 at 3:11 PM, Ken Kixmoeller <phph...@comcast.net>
> wrote:
> > Hi -- -
> >
> > Strange problem. One of my applications was just moved to a new server.
> The
> > new server has php configured to blacklist some functions (using
> > "disable_functions="). One of the "banned" functions is exec().
> >
> > The error log is reporting "shell_exec() has been disabled for security
> > reasons"  --- but exec() or shell_exec() are not in my code *anywhere*.
> The
> > program and line number being reported makes absolutely no sense.
> >
> > Are there other php commands that really call exec() or shell_exec() ???
> > Any clues how this could happen? Fixes (other than un-blacklisting the
> > command, of course)?
> >
> > Many thanks,
> >
> > Ken
>
>     If you're positive you aren't executing any command line code
> (backticks, passthru(), et cetera), then check to see if arbitrary
> code is somehow being attempted via your scripts.
>
> --
> </Daniel P. Brown>
> Network Infrastructure Manager
> http://www.php.net/
>

--- End Message ---
--- Begin Message ---
Yes -- Thanks Matjen and Daniel ---

There *was* a stray backtick in there. Weird that we haven't run into it
before.

Testing now.


On Tue, Apr 9, 2013 at 2:41 PM, Matijn Woudt <tijn...@gmail.com> wrote:

>
>
>
> On Tue, Apr 9, 2013 at 9:11 PM, Ken Kixmoeller <phph...@comcast.net>wrote:
>
>> Hi -- -
>>
>> Strange problem. One of my applications was just moved to a new server.
>> The
>> new server has php configured to blacklist some functions (using
>> "disable_functions="). One of the "banned" functions is exec().
>>
>> The error log is reporting "shell_exec() has been disabled for security
>> reasons"  --- but exec() or shell_exec() are not in my code *anywhere*.
>> The
>> program and line number being reported makes absolutely no sense.
>>
>> Are there other php commands that really call exec() or shell_exec() ???
>> Any clues how this could happen? Fixes (other than un-blacklisting the
>> command, of course)?
>>
>> Many thanks,
>>
>> Ken
>>
>
> The back tick(`) operator is also used for that same purpose. Maybe that's
> in your code?
>
> - Matijn
>
>

--- End Message ---
--- Begin Message ---
Yes --- it worked. Thank you so very much. I had searched the heck out of
this to no avail.

This is why I think developer communities are so great -- always someone
smarter than me (not that it is a high bar <s>) and willing to help.




On Tue, Apr 9, 2013 at 3:05 PM, Ken Kixmoeller <phph...@comcast.net> wrote:

> Yes -- Thanks Matjen and Daniel ---
>
> There *was* a stray backtick in there. Weird that we haven't run into it
> before.
>
> Testing now.
>
>
> On Tue, Apr 9, 2013 at 2:41 PM, Matijn Woudt <tijn...@gmail.com> wrote:
>
>>
>>
>>
>> On Tue, Apr 9, 2013 at 9:11 PM, Ken Kixmoeller <phph...@comcast.net>wrote:
>>
>>> Hi -- -
>>>
>>> Strange problem. One of my applications was just moved to a new server.
>>> The
>>> new server has php configured to blacklist some functions (using
>>> "disable_functions="). One of the "banned" functions is exec().
>>>
>>> The error log is reporting "shell_exec() has been disabled for security
>>> reasons"  --- but exec() or shell_exec() are not in my code *anywhere*.
>>> The
>>> program and line number being reported makes absolutely no sense.
>>>
>>> Are there other php commands that really call exec() or shell_exec() ???
>>> Any clues how this could happen? Fixes (other than un-blacklisting the
>>> command, of course)?
>>>
>>> Many thanks,
>>>
>>> Ken
>>>
>>
>> The back tick(`) operator is also used for that same purpose. Maybe
>> that's in your code?
>>
>> - Matijn
>>
>>
>

--- End Message ---
--- Begin Message ---
you probe command system()?



2013/4/9 Ken Kixmoeller <phph...@comcast.net>

> Yes --- it worked. Thank you so very much. I had searched the heck out of
> this to no avail.
>
> This is why I think developer communities are so great -- always someone
> smarter than me (not that it is a high bar <s>) and willing to help.
>
>
>
>
> On Tue, Apr 9, 2013 at 3:05 PM, Ken Kixmoeller <phph...@comcast.net>
> wrote:
>
> > Yes -- Thanks Matjen and Daniel ---
> >
> > There *was* a stray backtick in there. Weird that we haven't run into it
> > before.
> >
> > Testing now.
> >
> >
> > On Tue, Apr 9, 2013 at 2:41 PM, Matijn Woudt <tijn...@gmail.com> wrote:
> >
> >>
> >>
> >>
> >> On Tue, Apr 9, 2013 at 9:11 PM, Ken Kixmoeller <phph...@comcast.net
> >wrote:
> >>
> >>> Hi -- -
> >>>
> >>> Strange problem. One of my applications was just moved to a new server.
> >>> The
> >>> new server has php configured to blacklist some functions (using
> >>> "disable_functions="). One of the "banned" functions is exec().
> >>>
> >>> The error log is reporting "shell_exec() has been disabled for security
> >>> reasons"  --- but exec() or shell_exec() are not in my code *anywhere*.
> >>> The
> >>> program and line number being reported makes absolutely no sense.
> >>>
> >>> Are there other php commands that really call exec() or shell_exec()
> ???
> >>> Any clues how this could happen? Fixes (other than un-blacklisting the
> >>> command, of course)?
> >>>
> >>> Many thanks,
> >>>
> >>> Ken
> >>>
> >>
> >> The back tick(`) operator is also used for that same purpose. Maybe
> >> that's in your code?
> >>
> >> - Matijn
> >>
> >>
> >
>

--- End Message ---
--- Begin Message ---
Yes, but no further need. Problem solved.


On Tue, Apr 9, 2013 at 4:06 PM, El Ale... <alexissauc...@gmail.com> wrote:

> you probe command system()?
>
>
>
> 2013/4/9 Ken Kixmoeller <phph...@comcast.net>
>
>> Yes --- it worked. Thank you so very much. I had searched the heck out of
>> this to no avail.
>>
>> This is why I think developer communities are so great -- always someone
>> smarter than me (not that it is a high bar <s>) and willing to help.
>>
>>
>>
>>
>> On Tue, Apr 9, 2013 at 3:05 PM, Ken Kixmoeller <phph...@comcast.net>
>> wrote:
>>
>> > Yes -- Thanks Matjen and Daniel ---
>> >
>> > There *was* a stray backtick in there. Weird that we haven't run into it
>> > before.
>> >
>> > Testing now.
>> >
>> >
>> > On Tue, Apr 9, 2013 at 2:41 PM, Matijn Woudt <tijn...@gmail.com> wrote:
>> >
>> >>
>> >>
>> >>
>> >> On Tue, Apr 9, 2013 at 9:11 PM, Ken Kixmoeller <phph...@comcast.net
>> >wrote:
>> >>
>> >>> Hi -- -
>> >>>
>> >>> Strange problem. One of my applications was just moved to a new
>> server.
>> >>> The
>> >>> new server has php configured to blacklist some functions (using
>> >>> "disable_functions="). One of the "banned" functions is exec().
>> >>>
>> >>> The error log is reporting "shell_exec() has been disabled for
>> security
>> >>> reasons"  --- but exec() or shell_exec() are not in my code
>> *anywhere*.
>> >>> The
>> >>> program and line number being reported makes absolutely no sense.
>> >>>
>> >>> Are there other php commands that really call exec() or shell_exec()
>> ???
>> >>> Any clues how this could happen? Fixes (other than un-blacklisting the
>> >>> command, of course)?
>> >>>
>> >>> Many thanks,
>> >>>
>> >>> Ken
>> >>>
>> >>
>> >> The back tick(`) operator is also used for that same purpose. Maybe
>> >> that's in your code?
>> >>
>> >> - Matijn
>> >>
>> >>
>> >
>>
>
>

--- End Message ---

Reply via email to