php-general Digest 14 May 2012 00:13:33 -0000 Issue 7812

Topics (messages 317859 through 317870):

Re: Variables via url
        317859 by: Ashley Sheridan
        317860 by: TR Shaw
        317861 by: Tom Rogers
        317862 by: Ashley Sheridan
        317864 by: Adam Richardson
        317868 by: Ashley M. Kirchner

Re: alias address in REMOTE_ADDR
        317863 by: Mike Mackintosh

Time out issue
        317865 by: admin
        317866 by: Matijn Woudt
        317867 by: admin
        317869 by: Matijn Woudt

Re: Converting date string to unix timestamp
        317870 by: tamouse mailing lists

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 Sat, 2012-05-12 at 09:21 -0400, Jim Giner wrote:

> ""Ashley M. Kirchner"" <ash...@pcraft.com> wrote in message 
> news:4fad9d8b.4020...@pcraft.com...
> >
> >     Can someone point me at examples or directions on how I can pass a
> > variable via a URL in the following way:
> >
> >     http://server.domain.com//script///variable/
> >
> >     I will only be passing one single /variable/.  And I want the
> > /script/ to use that.
> >
> >     I don't want to see what the script is, for example I don't want it
> > to say 'script.php' or 'script.html' ...
> >
> >     Is this possible through PHP only, or do I have to write a rewrite
> > directive in Apache to accomplish this?
> >
> 
> A URL has to point to a script - how will your server know what to do with 
> the incoming URL if it doesn't point to something?  That said - format your 
> URL as a GET string and there's your variable.
> 
> Ex.:
> 
> http://server.domain.com/(scriptname)?variable&anothervariable&anothervariable
> 
> Or - if this url is coming from an already running script, you could post 
> the var to a session var and then send a url without the script name and let 
> your server's default document (index.php ?) receive it and look up the 
> session var, but that's a pretty silly way to handle things just to hide the 
> scriptname.
> 
> Of course, someone here with much more knowledge than I could very soon make 
> me look stupid  :) 
> 
> 
> 


I think what you're looking for is URL rewriting. PHP by itself can't do
that, you need to do it at the server level, so an .htaccess file would
be along the right lines.
-- 
Thanks,
Ash
http://www.ashleysheridan.co.uk



--- End Message ---
--- Begin Message ---
On May 12, 2012, at 9:47 AM, Ashley Sheridan wrote:

> On Sat, 2012-05-12 at 09:21 -0400, Jim Giner wrote:
> 
>> ""Ashley M. Kirchner"" <ash...@pcraft.com> wrote in message 
>> news:4fad9d8b.4020...@pcraft.com...
>>> 
>>>    Can someone point me at examples or directions on how I can pass a
>>> variable via a URL in the following way:
>>> 
>>>    http://server.domain.com//script///variable/
>>> 
>>>    I will only be passing one single /variable/.  And I want the
>>> /script/ to use that.
>>> 
>>>    I don't want to see what the script is, for example I don't want it
>>> to say 'script.php' or 'script.html' ...
>>> 
>>>    Is this possible through PHP only, or do I have to write a rewrite
>>> directive in Apache to accomplish this?
>>> 
>> 
>> A URL has to point to a script - how will your server know what to do with 
>> the incoming URL if it doesn't point to something?  That said - format your 
>> URL as a GET string and there's your variable.
>> 
>> Ex.:
>> 
>> http://server.domain.com/(scriptname)?variable&anothervariable&anothervariable
>> 
>> Or - if this url is coming from an already running script, you could post 
>> the var to a session var and then send a url without the script name and let 
>> your server's default document (index.php ?) receive it and look up the 
>> session var, but that's a pretty silly way to handle things just to hide the 
>> scriptname.
>> 
>> Of course, someone here with much more knowledge than I could very soon make 
>> me look stupid  :) 
>> 
>> 
>> 
> 
> 
> I think what you're looking for is URL rewriting. PHP by itself can't do
> that, you need to do it at the server level, so an .htaccess file would
> be along the right lines.

Ash is right; however you can leverage off of the "index page"  So your script 
would be in "index.php" and the url would be:

http://server.domain.com/some_optional_directory_path/?variable

Tom




--- End Message ---
--- Begin Message ---
Hello Ashley,

Saturday, May 12, 2012, 9:15:23 AM, you wrote:


>      Can someone point me at examples or directions on how I can pass a
> variable via a URL in the following way:

>      http://server.domain.com//script///variable/

>      I will only be passing one single /variable/.  And I want the 
> /script/ to use that.

>      I don't want to see what the script is, for example I don't want it
> to say 'script.php' or 'script.html' ...

>      Is this possible through PHP only, or do I have to write a rewrite
> directive in Apache to accomplish this?

You can add this to apache conf:

<FilesMatch "^phpscript$">
        ForceType application/x-httpd-php
</FilesMatch>

Then make a file called phpscript without extension and drop it in the
web root.

<?php
$info = explode('/', $_SERVER['PATH_INFO']);

Then your url would look like:

http://server.domain.com/phpscript/variable1/variable2


-- 
Best regards,
 Tom


--- End Message ---
--- Begin Message ---
On Sun, 2012-05-13 at 01:57 +1000, Tom Rogers wrote:

> Hello Ashley,
> 
> Saturday, May 12, 2012, 9:15:23 AM, you wrote:
> 
> 
> >      Can someone point me at examples or directions on how I can pass a
> > variable via a URL in the following way:
> 
> >      http://server.domain.com//script///variable/
> 
> >      I will only be passing one single /variable/.  And I want the 
> > /script/ to use that.
> 
> >      I don't want to see what the script is, for example I don't want it
> > to say 'script.php' or 'script.html' ...
> 
> >      Is this possible through PHP only, or do I have to write a rewrite
> > directive in Apache to accomplish this?
> 
> You can add this to apache conf:
> 
> <FilesMatch "^phpscript$">
>         ForceType application/x-httpd-php
> </FilesMatch>
> 
> Then make a file called phpscript without extension and drop it in the
> web root.
> 
> <?php
> $info = explode('/', $_SERVER['PATH_INFO']);
> 
> Then your url would look like:
> 
> http://server.domain.com/phpscript/variable1/variable2
> 
> 
> -- 
> Best regards,
>  Tom
> 
> 


As this method requires an Apache restart, I don't see what advantage
you have over using an .htaccess file?
-- 
Thanks,
Ash
http://www.ashleysheridan.co.uk



--- End Message ---
--- Begin Message ---
On Sat, May 12, 2012 at 12:25 PM, Ashley Sheridan
<a...@ashleysheridan.co.uk> wrote:
> As this method requires an Apache restart, I don't see what advantage
> you have over using an .htaccess file?

Performance:

http://httpd.apache.org/docs/current/howto/htaccess.html

"You should avoid using .htaccess files completely if you have access
to httpd main server config file. Using .htaccess files slows down
your Apache http server. Any directive that you can include in a
.htaccess file is better set in a Directory block, as it will have the
same effect with better performance."

"...putting this configuration in your server configuration file will
result in less of a performance hit, as the configuration is loaded
once when httpd starts, rather than every time a file is requested."

Adam

-- 
Nephtali:  A simple, flexible, fast, and security-focused PHP framework
http://nephtaliproject.com

--- End Message ---
--- Begin Message ---
On 5/12/2012 7:21 AM, Jim Giner wrote:
Of course, someone here with much more knowledge than I could very soon make me look stupid :)

Meh, I don't call that looking stupid. I call it a different way of skinning the cat. :) We're all here to learn from one another, right?

    Thanks for the suggestion.

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

On May 12, 2012, at 2:54, Jim Lucas <li...@cmsws.com> wrote:

> On 5/11/2012 10:57 PM, Tóth Csaba  wrote:
>> Hi Everyone,
>> 
>> I've run into a curious problem, not even really sure it's PHP, but that's 
>> where
>> I caught it, so here it is:
>> 
>> I have two servers hanging on the net, without proxies. Let's call them 
>> Server1
>> and Server2. Server1 has multiple IP addresses, configured as aliases. My 
>> problem:
>> When I do a wget --spider from 1 to 2, I get the eth0 (not alias) address in
>> Apache's accesslog on Server2. But when I do a 
>> file_get_contents(http://server2.tld),
>> and observe the $_SERVER['REMOTE_ADDR'] on Server2, I get one of the alias 
>> IP addresses
>> back. What can cause this? I really need the eth0 IP address back in 
>> REMOTE_ADDR.
>> 
>> Regards,
>> Csaba
>> 
> 
> What IP address is your Apache bound to?  You eth0 or one of the alias IPs?
> 
> Jim
> 
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> 

Do a netstat -ab and see what ip/ports apache is listening on. 

Mike Mackintosh
ZCE PHP5.3
www.highonphp.com

--- End Message ---
--- Begin Message ---
I am running Windows 2008 R2, IIS 7

I am running into an issue where no matter what I set the script  time out
to be the server is 

Giving me a 500 error  after like 60 seconds when the process exceeds the
configured activity timeout.

 

Here is the example script

<?

set_time_limit(120);

sleep(100);

Echo "PASSED THE TIME OUT";

?>

 

I fully understand this may not be a PHP error but if anyone has ran into
this issue with a windows server and 

can explain in detail how I can adjust the timeout, I would be very
grateful. 

Everything I have read online points to a fcgiext.ini file that does not
exist on my server.

 

Anyone know how to help ?


--- End Message ---
--- Begin Message ---
On Sat, May 12, 2012 at 9:42 PM, admin <ad...@buskirkgraphics.com> wrote:
> I am running Windows 2008 R2, IIS 7
>
> I am running into an issue where no matter what I set the script  time out
> to be the server is
>
> Giving me a 500 error  after like 60 seconds when the process exceeds the
> configured activity timeout.
>
>
>
> Here is the example script
>
> <?
>
> set_time_limit(120);
>
> sleep(100);
>
> Echo "PASSED THE TIME OUT";
>
> ?>
>
>
>
> I fully understand this may not be a PHP error but if anyone has ran into
> this issue with a windows server and
>
> can explain in detail how I can adjust the timeout, I would be very
> grateful.
>
> Everything I have read online points to a fcgiext.ini file that does not
> exist on my server.
>
>
>
> Anyone know how to help ?
>

Didn't use windows server in about 10 years (Go linux ;)), but did you try this?

http://www.microsoft.com/technet/prodtechnol/WindowsServer2003/Library/IIS/44ebc761-ac76-4b44-8894-551c9315af6c.mspx

- Matijn

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

-----Original Message-----
From: Matijn Woudt [mailto:tijn...@gmail.com] 
Sent: Saturday, May 12, 2012 3:54 PM
To: admin
Cc: php-gene...@lists.php.net
Subject: Re: [PHP] Time out issue

On Sat, May 12, 2012 at 9:42 PM, admin <ad...@buskirkgraphics.com> wrote:
> I am running Windows 2008 R2, IIS 7
>
> I am running into an issue where no matter what I set the script  time 
> out to be the server is
>
> Giving me a 500 error  after like 60 seconds when the process exceeds 
> the configured activity timeout.
>
>
>
> Here is the example script
>
> <?
>
> set_time_limit(120);
>
> sleep(100);
>
> Echo "PASSED THE TIME OUT";
>
> ?>
>
>
>
> I fully understand this may not be a PHP error but if anyone has ran 
> into this issue with a windows server and
>
> can explain in detail how I can adjust the timeout, I would be very 
> grateful.
>
> Everything I have read online points to a fcgiext.ini file that does 
> not exist on my server.
>
>
>
> Anyone know how to help ?
>

Didn't use windows server in about 10 years (Go linux ;)), but did you try this?

http://www.microsoft.com/technet/prodtechnol/WindowsServer2003/Library/IIS/44ebc761-ac76-4b44-8894-551c9315af6c.mspx

- Matijn

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


I had to get Microsoft on the phone to resolve this issue with IIS and FAST-CGI 
seems you can adjust the 
Request Timeout and Activity Timeout within the IIS manager and for some reason 
no documentation leads you to this point.

Sorry to bother issue resolved.










--- End Message ---
--- Begin Message ---
On Sat, May 12, 2012 at 10:19 PM, admin <ad...@buskirkgraphics.com> wrote:
>
>
> -----Original Message-----
> From: Matijn Woudt [mailto:tijn...@gmail.com]
> Sent: Saturday, May 12, 2012 3:54 PM
> To: admin
> Cc: php-gene...@lists.php.net
> Subject: Re: [PHP] Time out issue
>
> On Sat, May 12, 2012 at 9:42 PM, admin <ad...@buskirkgraphics.com> wrote:
>> I am running Windows 2008 R2, IIS 7
>>
>> I am running into an issue where no matter what I set the script  time
>> out to be the server is
>>
>> Giving me a 500 error  after like 60 seconds when the process exceeds
>> the configured activity timeout.
>>
>>
>>
>> Here is the example script
>>
>> <?
>>
>> set_time_limit(120);
>>
>> sleep(100);
>>
>> Echo "PASSED THE TIME OUT";
>>
>> ?>
>>
>>
>>
>> I fully understand this may not be a PHP error but if anyone has ran
>> into this issue with a windows server and
>>
>> can explain in detail how I can adjust the timeout, I would be very
>> grateful.
>>
>> Everything I have read online points to a fcgiext.ini file that does
>> not exist on my server.
>>
>>
>>
>> Anyone know how to help ?
>>
>
> Didn't use windows server in about 10 years (Go linux ;)), but did you try 
> this?
>
> http://www.microsoft.com/technet/prodtechnol/WindowsServer2003/Library/IIS/44ebc761-ac76-4b44-8894-551c9315af6c.mspx
>
> - Matijn
>
> --
> PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: 
> http://www.php.net/unsub.php
>
>
> I had to get Microsoft on the phone to resolve this issue with IIS and 
> FAST-CGI seems you can adjust the
> Request Timeout and Activity Timeout within the IIS manager and for some 
> reason no documentation leads you to this point.
>
> Sorry to bother issue resolved.
>

Again, Go linux.. Hehehe ;)

--- End Message ---
--- Begin Message ---
On Fri, May 11, 2012 at 8:46 PM, Karl DeSaulniers <k...@designdrumm.com> wrote:
> On another note, just curious why I keep getting your responses, but don't
> get the emails that I post.
> Anyone else having trouble with the list like that?

That is how the mailing list works. You don't see the messages you send.

--- End Message ---

Reply via email to