php-general Digest 1 Oct 2010 09:51:34 -0000 Issue 6968

Topics (messages 308377 through 308380):

Re: file_get_contents() failing on CentOS.
        308377 by: Richard Quadling

Re: PHP Email Question
        308378 by: J Ravi Menon

Re: Which PHP 5.3 documentation generators have you found?
        308379 by: Andrew Mason

htmlMicroscope-1.3.3, logAndHandler-0.8.2, with full sources.
        308380 by: Rene Veerman

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 30 September 2010 20:27, Adam Richardson <simples...@gmail.com> wrote:
> On Thu, Sep 30, 2010 at 5:02 AM, Richard Quadling <rquadl...@gmail.com>
> wrote:
>>
>> Hi.
>>
>> I'm trying to help a friend with a CentOS setup.
>>
>> He's installed PHP and SOAP using yum install php-soap and he is
>> having problems.
>>
>> I assisted in the developed the php script he is using and it is
>> working fine on Windows.
>>
>> In testing, we can do ...
>>
>> # wget http://www.php.net
>>
>> but not ...
>>
>> # php -r "echo file_get_contents('http://www.php.net');"
>> PHP Warning:  file_get_contents(http://www.php.net): failed to open
>> stream: HTTP request failed!  in Command line code on line 1
>>
>>
>> I've checked allow_url_fopen and that is set to 1
>>
>> As a test ...
>>
>> # php -d allow_url_fopen=1 -r "echo
>> file_get_contents('http://www.php.net');"
>> PHP Warning:  file_get_contents(http://www.php.net): failed to open
>> stream: HTTP request failed!  in Command line code on line 1
>> (This works fine on windows system)
>>
>> # php -d allow_url_fopen=0 -r "echo
>> file_get_contents('http://www.php.net');"
>> PHP Warning:  file_get_contents(): URL file-access is disabled in the
>> server configuration in Command line code on line 1
>> PHP Warning:  file_get_contents(http://www.php.net): failed to open
>> stream: no suitable wrapper could be found in Command line code on
>> line 1
>>
>> Neither will actually return the contents.
>>
>> Considering wget works and PHP doesn't _AND_ that this is linux, I'm lost.
>>
>> Wireshark shoes no communication at all when PHP is used to try and
>> get to www.php.net, but it does show everything accurately when using
>> wget.
>>
>> I've got the output of php -i and of the debug data from wget.
>>
>> So. Any pointers, suggestions, things to read/try/etc.
>>
>> Regards,
>>
>> Richard.
>>
>> --
>> Richard Quadling
>> Twitter : EE : Zend
>> @RQuadling : e-e.com/M_248814.html : bit.ly/9O8vFY
>>
>> --
>> PHP General Mailing List (http://www.php.net/)
>> To unsubscribe, visit: http://www.php.net/unsub.php
>>
>
> Some firewalls used to take exception to file_get_contents() requests whilst
> still allowing some http requests, and if I recall correctly, CentOS uses a
> pretty old version of PHP, so perhaps it's worth checking out:
> bugs[dot]php[dot]net/bug[dot]php?id=40197
> A shot in the dark.
> Adam
> P.S. - The link kept getting my reply marked as spam.  That pesky little
> php.net ;)
>
> --
> Nephtali:  PHP web framework that functions beautifully
> http://nephtaliproject.com
>

Thanks for that. I've passed the details on.

OOI, wget uses HTTP/1.1 ...

---request begin---
GET / HTTP/1.0
User-Agent: Wget/1.11.4 Red Hat modified
Accept: */*
Host: www.php.net
Connection: Keep-Alive


The bug report certainly matches the behaviour.

-- 
Richard Quadling
Twitter : EE : Zend
@RQuadling : e-e.com/M_248814.html : bit.ly/9O8vFY

--- End Message ---
--- Begin Message ---
On Wed, Sep 29, 2010 at 1:37 PM, Joe Jackson <priory...@googlemail.com> wrote:
> Hi
>
> I am trying the following snippet as Bostjan  suggested, and an email is
> getting sent when I submit the form however in the body of the email I am
> getting none of the form data in the body of the email.  All I am getting is
> the letter 'z' ?  Also in the from field of the email this is showing as my
> email address and not the email address of the user who has sent the form
>
> Any ideas on where I am going wrong with this snippet?  Any advice would be
> much appreciated
>
> $msgContent = "Name: ". $values['name'] ."\n";
> $msgContent .= "Address: ". $values['address'] ."\n";
> $msgContent .= "Telephone: ". $values['telephone'] ."\n";
> $msgContent .= "Email Address: ". $values['emailaddress'] ."\n";
> $msgContent .= "Message: ". $values['message'] ."\n";
>
> function ProcessForm($values)
> {
>     mail('myemail:domain.com', 'Website Enquiry', $msgContent, "From:
> \"{$values['name']}\" <{$values['emailaddress']}>");
>
>      // Replace with actual page or redirect :P
>     echo "<html><head><title>Thank you!</title></head><body>Thank
> you!</body></html>";

Not sure if it it is a typo above, are you actually passing
$msgContent in the function above? If it is a global variable, you
would need to add a 'global' declaration:

function ProcessForm($values)
{
   global $msgContent;

    mail('myemail:domain.com', 'Website Enquiry', $msgContent, "From:
\"{$values['name']}\" <{$values['emailaddress']}>\r\n");
.
.
.
}

Also try adding CRLF sequence at the end of the header line as shown above.

Ravi

--- End Message ---
--- Begin Message ---
On Fri, Oct 1, 2010 at 6:44 AM, David Harkness
<davi...@highgearmedia.com> wrote:
> While we don't use any 5.3 specific features such as namespaces yet, we set
> up our continuous integration system to use Doxygen. It runs significantly
> faster than phpDocumentor, though we put zero effort into tuning either
> system.
>

I started patching Doxygen a while ago but got sort of side tracked.
Out of PHPDocumentor and Doxygen, Doxygen seemed to be the closest as
it had namespace support already for other languages. only the tokens
needed changing. It uses Flex /Bison as the lexer and scanner so it's
pretty flexible. YMMV.

I have a bunch of FaiF code to release but i won't do so until i have
adequate documentation so I'll get around to adding support one of
these days.

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

I've just fixed many bugs in two free components of mine;

htmlMicroscope (63kb) is used to display very large php/js arrays and
objects in the browser,
in a collapsed but expandable view. It's loaded with features that make
browsing large
datasets fun. This 1.3.3 release fixes many of the bugs that remained.

logAndHandler (29+63=92kb) is used to catch all PHP warnings, errors and
notices in $_SESSION, and
then let them be requested by the browser after window.onload in a hide-able
pane in <body>.
It allows applications to report details in an array, which is then
displayed by htmlMicroscope.
And it also creates a XHTML javascript log, again with htmlMicroscope
integration, and also support for console.trace().

The link for the demos is somewhat unstable at the moment,
i hope to get that improved within a month.
http://mediabeez.ws/downloads is the link to the demos.

For now, it may be best to go to
http://code.google.com/p/rene7705-assorted-libraries/ and get the
sources to run on your own php server. Mysql isn't used.

I should note that this release works best with firefox.
Browser compatibility remains an issue, to be dealt with later.
Perhaps you can help, the puzzles aren't easy.
Chrome kinda works, haven't tested safari yet.

I welcome any improvements or suggestions you might have for these
components.

For the interested, here's the problems with IE compatibility;
http://social.msdn.microsoft.com/Forums/en-US/iewebdevelopment/thread/74f75b92-591b-4108-84d7-7dcbbd2728f6
http://social.msdn.microsoft.com/Forums/en-US/iewebdevelopment/thread/0144911a-3037-45a7-8a59-4f200aa26bb4


-- 
/*      _\|/_                                         _.----._
        (o o)                                       ,'.::.--..:._
.----oOO-{_}-OOo----------------------.            /::/_,-<o)::;_`-._
|                                     |           ::::::::`-';'`,--`-`
| Greetings from Rene AJM Veerman     |           ;::;'|::::,','
|   <rene7...@gmail.com>              |         ,'::/  ;:::/, :.
|   http://facebook.com/rene7705      |        /,':/  /::;' \ ':\
|                                     |       :'.:: ,-''   . `.::\
|                                     |       \.:;':.    `    :: .:
|                                     |       (;' ;;;       .::' :|
|                                     |        \,:;;      \ `::.\.\
|                                     |        `);'        '::'  `:
|                                     |          `.: ..  -. ' :. :/  _.-'
_.-
|                                     |          `.: ..  -. ' :. :/  _.-'
_.-
| My free open-source                 |            >;._.:._.;,-=_(.-'  __
`._
| web components:                     |          ,;'  _..-((((''  .,-''
 `-._
|   http://mediabeez.ws/downloads     |       _,'<.-''  _..``'.'`-'`.
 `
|   http://code.google.com/u/rene7705 |   _.-((((_..--''       \ \ `.`.
|                                     | -'  _.``'               \      ` SSt
|                                     |   ,'
`------------------------------------*/

--- End Message ---

Reply via email to