php-general Digest 2 Apr 2012 14:38:52 -0000 Issue 7757

Topics (messages 317410 through 317427):

Variable representation
        317410 by: Ron Piggott
        317413 by: Adam Randall
        317414 by: Mihamina Rakotomandimby
        317415 by: Mihamina Rakotomandimby
        317416 by: tamouse mailing lists
        317417 by: tamouse mailing lists
        317418 by: tamouse mailing lists
        317421 by: Maciek Sokolewicz

PHP ISSUE!!!
        317411 by: Karl James
        317412 by: tamouse mailing lists

Re: Could apc_fetch return a pointer to data in shared memory ?
        317419 by: Simon Schick
        317420 by: Simon
        317422 by: Maciek Sokolewicz
        317424 by: Simon
        317425 by: Stuart Dallas
        317427 by: Simon

Dynamic open_basedir and mod_vhost_alias
        317423 by: Alex Domoradov

building php x64 for windows
        317426 by: СÓãϺ

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 ---
Hi Everyone:

I am assigning the value of 4 images to variables following a database query: 

$image_1 = stripslashes( $row['image_1'] );
$image_2 = stripslashes( $row['image_2'] );
$image_3 = stripslashes( $row['image_3'] );
$image_4 = stripslashes( $row['image_4'] );

What I need help with is how to represent the variable using $i for the number 
portion in the following WHILE loop.  I am not sure of how to correctly do it.  
I am referring to: $image_{$i}

===
$i = 1;
while ( $i <= 4 ) {

    if ( trim( $image_{$i} ) <> "" ) { 
    
        echo "<li><a href=\"http://www.theverseoftheday.info/store-images/"; . 
$image_{$i} . "\" title=\"Image " . $i . "\">Image " . $i . "</a></li>\r\n";
                        
    }

++$i;
}
===

How do I substitute $i for the # so I may use a WHILE loop to display the 
images?  (Not all 4 variables have an image.)

Ron Piggott



www.TheVerseOfTheDay.info 

--- End Message ---
--- Begin Message ---
It would better to just use an array, and then iterate through that.

$images[] =  stripslashes( $row['image_1'] );
$images[] =  stripslashes( $row['image_2'] );
$images[] =  stripslashes( $row['image_3'] );
$images[] =  stripslashes( $row['image_4'] );

foreach( $images as $k => $v ) {
    $k++; // increment k since it starts at 0, instead of 1
    if ( strlen( trim( $v ) ) ) {
        echo "<li><a href=\"http://www.theverseoftheday.info/store-images/";
. $v . "\" title=\"Image " . $k . "\">Image " . $k . "</a></li>\r\n";
    }
}

Adam.

On Sun, Apr 1, 2012 at 8:52 PM, Ron Piggott
<ron.pigg...@actsministries.org>wrote:

> Hi Everyone:
>
> I am assigning the value of 4 images to variables following a database
> query:
>
> $image_1 = stripslashes( $row['image_1'] );
> $image_2 = stripslashes( $row['image_2'] );
> $image_3 = stripslashes( $row['image_3'] );
> $image_4 = stripslashes( $row['image_4'] );
>
> What I need help with is how to represent the variable using $i for the
> number portion in the following WHILE loop.  I am not sure of how to
> correctly do it.  I am referring to: $image_{$i}
>
> ===
> $i = 1;
> while ( $i <= 4 ) {
>
>    if ( trim( $image_{$i} ) <> "" ) {
>
>        echo "<li><a href=\"http://www.theverseoftheday.info/store-images/";
> . $image_{$i} . "\" title=\"Image " . $i . "\">Image " . $i .
> "</a></li>\r\n";
>
>    }
>
> ++$i;
> }
> ===
>
> How do I substitute $i for the # so I may use a WHILE loop to display the
> images?  (Not all 4 variables have an image.)
>
> Ron Piggott
>
>
>
> www.TheVerseOfTheDay.info
>



-- 
Adam Randall
http://www.xaren.net
AIM: blitz574
Twitter: @randalla0622

"To err is human... to really foul up requires the root password."

--- End Message ---
--- Begin Message ---
On 04/02/2012 07:46 AM, Adam Randall wrote:
$images[] =  stripslashes( $row['image_1'] );
$images[] =  stripslashes( $row['image_2'] );
$images[] =  stripslashes( $row['image_3'] );
$images[] =  stripslashes( $row['image_4'] );

$images[1] =  stripslashes( $row['image_1'] );
$images[2] =  stripslashes( $row['image_2'] );
$images[3] =  stripslashes( $row['image_3'] );
$images[4] =  stripslashes( $row['image_4'] );

would "force" the order.

--
RMA.

--- End Message ---
--- Begin Message ---
On 04/02/2012 06:52 AM, Ron Piggott wrote:
$image_1 = stripslashes( $row['image_1'] );
$image_2 = stripslashes( $row['image_2'] );
$image_3 = stripslashes( $row['image_3'] );
$image_4 = stripslashes( $row['image_4'] );
[...] (Not all 4 variables have an image.)

How is it meant in the database?
If it's NULL have a look at this http://goo.gl/89fYv


--
RMA.

--- End Message ---
--- Begin Message ---
On Sun, Apr 1, 2012 at 10:52 PM, Ron Piggott
<ron.pigg...@actsministries.org> wrote:
> Hi Everyone:
>
> I am assigning the value of 4 images to variables following a database query:
>
> $image_1 = stripslashes( $row['image_1'] );
> $image_2 = stripslashes( $row['image_2'] );
> $image_3 = stripslashes( $row['image_3'] );
> $image_4 = stripslashes( $row['image_4'] );
>
> What I need help with is how to represent the variable using $i for the 
> number portion in the following WHILE loop.  I am not sure of how to 
> correctly do it.  I am referring to: $image_{$i}
>
> ===
> $i = 1;
> while ( $i <= 4 ) {
>
>    if ( trim( $image_{$i} ) <> "" ) {
>
>        echo "<li><a href=\"http://www.theverseoftheday.info/store-images/"; . 
> $image_{$i} . "\" title=\"Image " . $i . "\">Image " . $i . "</a></li>\r\n";
>
>    }
>
> ++$i;
> }
> ===
>
> How do I substitute $i for the # so I may use a WHILE loop to display the 
> images?  (Not all 4 variables have an image.)
>
> Ron Piggott
>
>
>
> www.TheVerseOfTheDay.info

While this doesn't answer your question directly (I will get to it in
a moment), you might be better able to use $image as an array and
assign the values as:

$image[1] = stripslashes( $row['image_1'] );
$image[2] = stripslashes( $row['image_2'] );
$image[3] = stripslashes( $row['image_3'] );
$image[4] = stripslashes( $row['image_4'] );

While noting that arrays in php start indexing at 0, that doens't
really matter al that much in your implementation. Assuming you need
to set the four image variables separate from the part where you emit
the HTML stuff, you can write a loop:

foreach (range(1,4) as $i) {
    $image[$i] = stripslashes($row['image_'.$i]);
}

which might be slightly less obvious to some, but I think is better code.

Then:

foreach (range(1,4) as $i) {
    if (!empty(trim($images[$i]))) {
        echo "<li><a
href=\"http://www.theverseoftheday.info/store-images/"; . $image[$i] .
"\" title=\"Image " . $i . "\">Image " . $i . "</a></li>\r\n";
    }
}

(If you don't need the four images outside of the place you're
emitting the HTML, you don't even need to use the intermediate
$image[] array, really, and can combing the whole thing in one swell
foop:

foreach (range(1,4) as $i) {
    if (!empty($image = trim(stripslashes($row['image_'.$i])))) {
       echo "<li><a
href=\"http://www.theverseoftheday.info/store-images/"; . $image . "\"
title=\"Image " . $i . "\">Image " . $i . "</a></li>\r\n";
    }
}

And skip the array altogether.)

As for doing what you originally asked, that requires doing an eval()
on the statement utilizing string interpolation, like so:

  eval('echo "image $i is $image_' . $i . '".PHP_EOL;');

but I think that's a bit harder to read and understand what's going
on. When you have to add in escaped quotes and such, it gets much
hairier.

To utilize it in the loop you have above, I'd split the echoes up:

   echo "<li><a href=\"http://www.theverseoftheday.info/store-images/";;
   eval ('echo "$image_" . $i;');
   echo "\" title=\"Image " . $i . "\">Image " . $i . "</a></li>\r\n";

so that the eval portion is doing only what needs to be interpolated
and evaled. The rest of the output is fine the way it is.

Note that if you did this:

   echo "<li><a href=\"http://www.theverseoftheday.info/store-images/";
. eval('echo "$image_" . $i;') . "\" title=\"Image " . $i . "\">Image
" . $i . "</a></li>\r\n";

the part in the eval would get written out first, then the rest of the
echoed string, which is why you would need to split them up first.

Generally, I think it's best to completely avoid using eval unless
there is no other way to do what you want.

--- End Message ---
--- Begin Message ---
Ugh, gmail mangled the code there. Here's a pastebin of the response
which is better formatted: http://pastie.org/3712761

--- End Message ---
--- Begin Message ---
On Mon, Apr 2, 2012 at 12:20 AM, tamouse mailing lists
<tamouse.li...@gmail.com> wrote:
> Ugh, gmail mangled the code there. Here's a pastebin of the response
> which is better formatted: http://pastie.org/3712761

Sweet. I spent so long on my reply, two others snuck in before me. :)

--- End Message ---
--- Begin Message ---
On 02-04-2012 07:15, tamouse mailing lists wrote:
As for doing what you originally asked, that requires doing an eval()
on the statement utilizing string interpolation, like so:

   eval('echo "image $i is $image_' . $i . '".PHP_EOL;');

but I think that's a bit harder to read and understand what's going
on. When you have to add in escaped quotes and such, it gets much
hairier.

To utilize it in the loop you have above, I'd split the echoes up:

    echo "<li><a href=\"http://www.theverseoftheday.info/store-images/";;
    eval ('echo "$image_" . $i;');
    echo "\" title=\"Image " . $i . "\">Image " . $i . "</a></li>\r\n";

so that the eval portion is doing only what needs to be interpolated
and evaled. The rest of the output is fine the way it is.

Note that if you did this:

    echo "<li><a href=\"http://www.theverseoftheday.info/store-images/";
. eval('echo "$image_" . $i;') . "\" title=\"Image " . $i . "\">Image
" . $i ."</a></li>\r\n";

the part in the eval would get written out first, then the rest of the
echoed string, which is why you would need to split them up first.

Generally, I think it's best to completely avoid using eval unless
there is no other way to do what you want.

Usually if you think you need to use eval: think again. In this case, it again holds true.

Instead of doing what you do, you can also reference the variable as:
echo ${'image_'.$i};
or
echo $GLOBALS['image_'.$i];

Both are preferable by far over using eval, with all its potential security concerns.

As for the original threat-author's request. I agree with you that a simple bit of code as below should work fine:
foreach(range(1,4) as $i) {
   if(strlen($img=trim($row['image_'.$i])) > 0) {
      echo '<li>',
             '<a href="http://example.com/path/'.$img.'">',
               'Image '.$i,
             '</a>',
           '</li>',
           PHP_EOL;
   }
}

[and yes, I prefer using comma notation in echo to split it into clear, readable parts]
- Tul

--- End Message ---
--- Begin Message ---
Is anyone online at the moment.

I need help with a phpmyadmin table issue.

I get a critical error when I try to upload images

>From the web portal admin page.

I can send you a screen shot and allow you access to

The database to help out. Some have told me this is 

A Auto_increment issue, but this table I think has it turned

On if I am reading the website correctly on the options section/tab.

 

MYSQL: duplicate entry '0' for key 1.

MYSQL: Insert Error - Duplicate entry '0' 

 

Can anyone help me walk me through step by step.

I know it's a simple setting I am missing. 

Can anyone please help me at the moment.

OF course you can email instantly then maybe chant via

FB or Aim...Need help really fast.

If I can do this I can get job doing web design and possibly

Reach my goal and be a web designer.

I just really do not know phpmyadmin that well to fix issues like this yet.

 

 

 

 

 

 <mailto:karlja...@tampabay.rr.com> Karl James

 


--- End Message ---
--- Begin Message ---
On Sun, Apr 1, 2012 at 11:03 PM, Karl James <karlja...@tampabay.rr.com> wrote:
> Is anyone online at the moment.
>
> I need help with a phpmyadmin table issue.
>
> I get a critical error when I try to upload images
>
> From the web portal admin page.
>
> I can send you a screen shot and allow you access to
>
> The database to help out. Some have told me this is
>
> A Auto_increment issue, but this table I think has it turned
>
> On if I am reading the website correctly on the options section/tab.
>
>
>
> MYSQL: duplicate entry '0' for key 1.
>
> MYSQL: Insert Error - Duplicate entry '0'
>
>
>
> Can anyone help me walk me through step by step.
>
> I know it's a simple setting I am missing.
>
> Can anyone please help me at the moment.
>
> OF course you can email instantly then maybe chant via
>
> FB or Aim...Need help really fast.
>
> If I can do this I can get job doing web design and possibly
>
> Reach my goal and be a web designer.
>
> I just really do not know phpmyadmin that well to fix issues like this yet.
>
>
>
>
>
>
>
>
>
>
>
>  <mailto:karlja...@tampabay.rr.com> Karl James
>
>
>

I'm on now. This doesn't sound much like a php issue, per se. You
might be able to find someone on #mysql on irc.freenode.net to walk
you through what's going wrong in real time.

if you don't have an irc client handy, you can use the web chat client
at http://webchat.freenode.net or http://chat.mibbit.com

--- End Message ---
--- Begin Message ---
2012/4/1 Simon <slg...@gmail.com>
>
> Another thing that's possible in .NET is the Singleton design pattern.
> (Application variables are an implementation of this pattern)
>
> This makes it possible to instantiate a static class so that a single
> instance of the object is available to all threads (ie requests) across
> your application.
>
> So for example the code below creates a single instance of an object for
> the entire "server". Any code calling "new App();"  gets a pointer to the
> shared object.
>
> If PHP could do this, it would be *awesome* and I wouldn't need
> application
> variables since this is a superior solution.
>
> Can / could PHP do anything like this ?
>
> public class App
> {
>   private static App instance;
>   private App() {}
>   public static App Instance
>   {
>      get
>      {
>         if (instance == null)
>         {
>            instance = new App();
>         }
>         return instance;
>      }
>   }
> }
>
>
> Creates an inste

Hi, Simon

Sorry for this out-of-context post - but just to answer to Simon's question:

One way of implementing Singleton in PHP is written down in the php-manual:
http://www.php.net/manual/en/language.oop5.patterns.php
I personally would also declare __clone() and __wakeup() as private,
but that's something personal :)

If you have many places where you'd like to use the Singleton-pattern
you may now think of having one class where you define the pattern
itself and extending other classes from that ... But that does not
seem the good way to me because this classes are not related at all,
in case of content.
Other frameworks are using interfaces but they have to write the code
for the implementation over and over again.

Here's where traids make the most sense to me:
http://stackoverflow.com/questions/7104957/building-a-singleton-trait-with-php-5-4

Bye
Simon

--- End Message ---
--- Begin Message ---
Thanks Simon. you got my hopes up there for a second.

>From the php docs page:

>Critics further argue that it is pointless to use a Singleton in a Shared
Nothing Architecture like PHP where objects are unique >within the Request
only anyways.

I want the the singleton class to be global to the entire application (ie
shared "by reference" across all requests). I'd agree with the above
critics that if you have to instantiate your singleton for each request,
it's rather pointless.

On 2 April 2012 07:54, Simon Schick <simonsimc...@googlemail.com> wrote:

> 2012/4/1 Simon <slg...@gmail.com>
> >
> > Another thing that's possible in .NET is the Singleton design pattern.
> > (Application variables are an implementation of this pattern)
> >
> > This makes it possible to instantiate a static class so that a single
> > instance of the object is available to all threads (ie requests) across
> > your application.
> >
> > So for example the code below creates a single instance of an object for
> > the entire "server". Any code calling "new App();"  gets a pointer to the
> > shared object.
> >
> > If PHP could do this, it would be *awesome* and I wouldn't need
> > application
> > variables since this is a superior solution.
> >
> > Can / could PHP do anything like this ?
> >
> > public class App
> > {
> >   private static App instance;
> >   private App() {}
> >   public static App Instance
> >   {
> >      get
> >      {
> >         if (instance == null)
> >         {
> >            instance = new App();
> >         }
> >         return instance;
> >      }
> >   }
> > }
> >
> >
> > Creates an inste
>
> Hi, Simon
>
> Sorry for this out-of-context post - but just to answer to Simon's
> question:
>
> One way of implementing Singleton in PHP is written down in the php-manual:
> http://www.php.net/manual/en/language.oop5.patterns.php
> I personally would also declare __clone() and __wakeup() as private,
> but that's something personal :)
>
> If you have many places where you'd like to use the Singleton-pattern
> you may now think of having one class where you define the pattern
> itself and extending other classes from that ... But that does not
> seem the good way to me because this classes are not related at all,
> in case of content.
> Other frameworks are using interfaces but they have to write the code
> for the implementation over and over again.
>
> Here's where traids make the most sense to me:
>
> http://stackoverflow.com/questions/7104957/building-a-singleton-trait-with-php-5-4
>
> Bye
> Simon
>

--- End Message ---
--- Begin Message ---
On 02-04-2012 10:12, Simon wrote:
Thanks Simon. you got my hopes up there for a second.

 From the php docs page:

Critics further argue that it is pointless to use a Singleton in a Shared
Nothing Architecture like PHP where objects are unique>within the Request
only anyways.

I want the the singleton class to be global to the entire application (ie
shared "by reference" across all requests). I'd agree with the above
critics that if you have to instantiate your singleton for each request,
it's rather pointless.

Well, that's simply not possible due to the "shared nothing paradigm". If you want to share, you need to either share it via another medium (such as a database, as has been suggested a dozen times already) or switch to a different language. PHP is based on this paradigm, and you should not expect of it to violate it just because you want to do things a certain way, which is not the PHP way.

- Tul


--- End Message ---
--- Begin Message ---
Thanks Maciek

On 2 April 2012 10:37, Maciek Sokolewicz <maciek.sokolew...@gmail.com>wrote:

> On 02-04-2012 10:12, Simon wrote:
>
>> Thanks Simon. you got my hopes up there for a second.
>>
>>  From the php docs page:
>>
>>  Critics further argue that it is pointless to use a Singleton in a Shared
>>>
>> Nothing Architecture like PHP where objects are unique>within the Request
>> only anyways.
>>
>> I want the the singleton class to be global to the entire application (ie
>> shared "by reference" across all requests). I'd agree with the above
>> critics that if you have to instantiate your singleton for each request,
>> it's rather pointless.
>>
>>  Well, that's simply not possible due to the "shared nothing paradigm".
> If you want to share, you need to either share it via another medium (such
> as a database, as has been suggested a dozen times already) or switch to a
> different language.



> PHP is based on this paradigm, and you should not expect of it to violate
> it just because you want to do things a certain way, which is not the PHP
> way.
>

The existence of memcached, shm and apc_fetch tell me that PHP already
accepts the need for sharing data between processes. All I'm arguing for is
the ability to share the data by reference rather than by copy.


>
> - Tul
>
>

--- End Message ---
--- Begin Message ---
On 2 Apr 2012, at 14:12, Simon wrote:

> Thanks Maciek
> 
> On 2 April 2012 10:37, Maciek Sokolewicz <maciek.sokolew...@gmail.com>wrote:
> 
>> On 02-04-2012 10:12, Simon wrote:
>> 
>>> Thanks Simon. you got my hopes up there for a second.
>>> 
>>> From the php docs page:
>>> 
>>> Critics further argue that it is pointless to use a Singleton in a Shared
>>>> 
>>> Nothing Architecture like PHP where objects are unique>within the Request
>>> only anyways.
>>> 
>>> I want the the singleton class to be global to the entire application (ie
>>> shared "by reference" across all requests). I'd agree with the above
>>> critics that if you have to instantiate your singleton for each request,
>>> it's rather pointless.
>>> 
>>> Well, that's simply not possible due to the "shared nothing paradigm".
>> If you want to share, you need to either share it via another medium (such
>> as a database, as has been suggested a dozen times already) or switch to a
>> different language.
> 
> 
> 
>> PHP is based on this paradigm, and you should not expect of it to violate
>> it just because you want to do things a certain way, which is not the PHP
>> way.
>> 
> 
> The existence of memcached, shm and apc_fetch tell me that PHP already
> accepts the need for sharing data between processes. All I'm arguing for is
> the ability to share the data by reference rather than by copy.


As already mentioned several times the closest you will get is shared memory 
(as used by APC), but you can't access that by reference because shared 
read/write resources need controlled access for stability.

I can't find any material that explains how the .net framework implements 
application variables. You mentioned earlier that you *know* that when you 
access them you do so by reference. Do you have a source for this knowledge or 
is it some sort of sixth sense?

I would not feel comfortable having my code creating multiple pointers to a 
read/write segment of shared memory that then uncontrollably float around 
umpteen processes. If MS have something akin to this in .net I would be 
extremely interested in reading about how it works without imploding.

-Stuart

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

--- End Message ---
--- Begin Message ---
On 2 April 2012 14:27, Stuart Dallas <stu...@3ft9.com> wrote:

> On 2 Apr 2012, at 14:12, Simon wrote:
>
> > Thanks Maciek
> >
> > On 2 April 2012 10:37, Maciek Sokolewicz <maciek.sokolew...@gmail.com
> >wrote:
> >
> >> On 02-04-2012 10:12, Simon wrote:
> >>
> >>> Thanks Simon. you got my hopes up there for a second.
> >>>
> >>> From the php docs page:
> >>>
> >>> Critics further argue that it is pointless to use a Singleton in a
> Shared
> >>>>
> >>> Nothing Architecture like PHP where objects are unique>within the
> Request
> >>> only anyways.
> >>>
> >>> I want the the singleton class to be global to the entire application
> (ie
> >>> shared "by reference" across all requests). I'd agree with the above
> >>> critics that if you have to instantiate your singleton for each
> request,
> >>> it's rather pointless.
> >>>
> >>> Well, that's simply not possible due to the "shared nothing paradigm".
> >> If you want to share, you need to either share it via another medium
> (such
> >> as a database, as has been suggested a dozen times already) or switch
> to a
> >> different language.
> >
> >
> >
> >> PHP is based on this paradigm, and you should not expect of it to
> violate
> >> it just because you want to do things a certain way, which is not the
> PHP
> >> way.
> >>
> >
> > The existence of memcached, shm and apc_fetch tell me that PHP already
> > accepts the need for sharing data between processes. All I'm arguing for
> is
> > the ability to share the data by reference rather than by copy.
>
>
> As already mentioned several times the closest you will get is shared
> memory (as used by APC), but you can't access that by reference because
> shared read/write resources need controlled access for stability.
>

I know. I understand that (and the issues with locking that might arise if
truly shared memory was available).


>
> I can't find any material that explains how the .net framework implements
> application variables. You mentioned earlier that you *know* that when you
> access them you do so by reference. Do you have a source for this knowledge
> or is it some sort of sixth sense?
>

Source: 10+ years as an ASP and ASP.NET developer.

Having looked for documentation, I agree, it's utterly terrible. It's as if
even Microsoft themselves don't fully understand the advantages that
application variables give them over the competition. (Though they're
hardly likely to be forthcoming about helping others implement similar
features).

Here's some stuff I did find:

http://www.codeproject.com/Articles/87316/A-walkthrough-to-Application-State#e
This article explains basically how application variables work. It doesn't
specifically mention passing by reference but it discusses thread safety at
some length so you might infer that implies passing by reference.

http://msdn.microsoft.com/en-us/library/ff650849.aspx
Here is a more technical discussion about the singleton class is
implemented in .NET. Application variables are provided by an instance of a
singleton class (the HttpApplication class).

http://stackoverflow.com/questions/1132373/do-asp-net-application-variables-pass-by-reference-or-value
Stack overflow question from someone actually wanting to get a *copy* of an
application variable rather than a reference.

So, if you read enough of this stuff, you'll find out that a .NET website
(an IIS application in MS parlance) runs in a multi-threaded single
process. Application variables (and singleton classes) are shared by
reference between all threads. It is possible to run an IIS application
over multiple processes (to take advantage of multiple processors / server
farms for example) but then the Application variables are not shared at
all. (This is then pretty comparable to the situation with node.js except
that node is not multi-threaded)






>
> I would not feel comfortable having my code creating multiple pointers to
> a read/write segment of shared memory that then uncontrollably float around
> umpteen processes. If MS have something akin to this in .net I would be
> extremely interested in reading about how it works without imploding.
>
> -Stuart
>
> --
> Stuart Dallas
> 3ft9 Ltd
> http://3ft9.com/
>

--- End Message ---
--- Begin Message ---
Maybe anyone can point me in the right direction.

I need to modify this patch
http://www.phpbuilder.com/lists/php-developer-list/2000101/0994.php
and replace VIRTUAL_DOCUMENT_ROOT with real path.

As described in patch note - "When using mod_vhost_alias the
DOCUMENT_ROOT = PATH_TRANSLATED -
SCRIPT_NAME(request_uri)"

But in fact this is not always true. If we used any redirection
(mod_rewrite) for example, in the request_uri would be modified uri

For example

1. Without any redirects
url - http://project.domain.com/subdir1/test.php
SG(request_info).path_translated=/var/www/vhosts/project/subdir1/test.php
SG(request_info).request_uri=/subdir1/test.php

Looks everything is ok.

doc_root = strncpy( real_open_basedir_path,
SG(request_info).path_translated,
strlen(SG(request_info).path_translated) -
strlen(SG(request_info).request_uri) );

2. With some kind of redirects
url - http://magento.domain.com/index.php
SG(request_info).path_translated=/var/www/vhosts/magento/index.php
SG(request_info).request_uri=/index.php/install

And that is a BIG problem.

So my question. Could we get in php, maybe through apache API original
uri or doc_root? So latter we can replace VIRTUAL_DOCUMENT_ROOT in
PG(open_basedir) with the real path?

--- End Message ---
--- Begin Message ---
I want to building php5.4  x64 for windows. I have see 
https://wiki.php.net/internals/windows/stepbystepbuild.


but I do extensions always show wrong.  Have any friend help for this?


php error LNK2019 unresolved external.


-- Yon.

--- End Message ---

Reply via email to