php-general Digest 4 Apr 2010 22:26:30 -0000 Issue 6675

Topics (messages 303806 through 303817):

Just a test.
        303806 by: ttplayer

About the php mail function and imap_mail function
        303807 by: ttplayer
        303808 by: dispy
        303812 by: Andre Polykanine

Re: PHP (32 bit) on IIS7.5 and MySQL 5.1.45 (64 bit) -> established connection 
failed because connected host has failed to respond
        303809 by: SED
        303810 by: ralston

$_SERVER['PHP_AUTH_USER'] has gone
        303811 by: Satz Klauer
        303813 by: Nilesh Govindarajan
        303814 by: shiplu
        303815 by: Nathan Rixham
        303816 by: Daniel P. Brown

Howto send command over ssh using sockets
        303817 by: Radek Krejèa

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. Have a good day.
 This is just a test if my email address has been added to the mailing list.

--- End Message ---
--- Begin Message ---
Hi, everyone!
 I have a problem about the php mail function and imap_mail function.
 When I use the mail or imap_mail function to send a email, the php script 
sends the email through the local mail sever with sendmail or another MTA 
supported. However, I have a gmail account. I just want the php script to send 
emails via my gmail account. How can I do it?
 Thank you.

--- End Message ---
--- Begin Message ---
Am 04.04.2010 14:28, schrieb ttplayer:
> Hi, everyone!
>  I have a problem about the php mail function and imap_mail function.
>  When I use the mail or imap_mail function to send a email, the php script 
> sends the email through the local mail sever with sendmail or another MTA 
> supported. However, I have a gmail account. I just want the php script to 
> send emails via my gmail account. How can I do it?
>  Thank you.
a) use an external SMTP-class, you could take a look at PEAR (which
directly etablishes a connection to your gmail-account)
b) configure your mail-server/system that he delivers the mails via an
external SMTP_Server - there are several tutorials how to do that in the
inet



Regards,

Valentin Dreismann

--- End Message ---
--- Begin Message ---
Hello ttplayer,

If GMail does allow sending through socket, wait a bit, I'll upload a
class written on my own for sending mail through a custom SMTP via
socket.
-- 
With best regards from Ukraine,
Andre
Skype: Francophile; Wlm&MSN: arthaelon @ yandex.ru; Jabber: arthaelon @ 
jabber.org
Yahoo! messenger: andre.polykanine; ICQ: 191749952
Twitter: m_elensule

----- Original message -----
From: ttplayer <f...@qq.com>
To: php-general <php-gene...@lists.php.net>
Date: Sunday, April 4, 2010, 3:28:33 PM
Subject: [PHP] About the php mail function and imap_mail function

Hi, everyone!
 I have a problem about the php mail function and imap_mail function.
 When I use the mail or imap_mail function to send a email, the php script 
sends the email through the local mail sever with sendmail or another MTA 
supported. However, I have a gmail account. I just want the php script to send 
emails via my gmail account. How can I do it?
 Thank you.


--- End Message ---
--- Begin Message ---
Hi Kevin,

Thank you for your assistance. I finally gave up and let my self to default
Microsoft Installation for IIS7.5+PHP+MySQL.

Everything runs fine on my developer machine - and that was my main goal -
so I'm fine.

However, after about 48 hours of search, I was not able to find to how to do
this manually - and it shock me (as a open source fan). At least, my Linuxs'
servers are still intact.

Ps. there is still snowing here in Iceland (heat -15°C in wind) and a
volcano eruption that is growing. :)

Thanks for your help,
Summi

-----Original Message-----
From: SED [mailto:s...@sed.is] 
Sent: 4. apríl 2010 10:06
To: 'Kevin Kinsey'
Cc: php-gene...@lists.php.net
Subject: RE: [PHP] PHP (32 bit) on IIS7.5 and MySQL 5.1.45 (64 bit) ->
established connection failed because connected host has failed to respond

Hi Kevin,

- MySQL 5.1 (64bit) is listening at port 0.0.0.0:3306
- MySQL 4.1 (32bit) is listening at port 0.0.0.0:3307
- When running MySQL command via PHP (CMD or browser) I get 127.0.0.1:3306
Established
- I can connect to MySQL via CMD or MySQL Administrator GUI.
- PHP (32bit) loads php_mysql.dll
- php.ini works 100%
- All Firewalls are disabled on LAN

- Is this a PHP bug or am I getting crazy? ;-)    
- Is there a 64bit of PHP who is assumed ok for develope machine with
firewalls?

Regards,
Summi

-----Original Message-----
From: Kevin Kinsey [mailto:k...@daleco.biz]
Sent: 4. apríl 2010 01:02
To: Sumarliði Einar Daðason
Cc: php-gene...@lists.php.net
Subject: Re: [PHP] PHP (32 bit) on IIS7.5 and MySQL 5.1.45 (64 bit) ->
established connection failed because connected host has failed to respond

Sumarliði Einar Daðason wrote:

> I have setup PHP (32 bit) on IIS7.5 and MySQL 5.1.45 (64 bit)  with
success.
> phpinfo() shows the MySQL extension loaded, but when I try to use 
> mysql_connect( $host, $user, $password ) in a PHP script I get 
> following
> error:
> 
> PHP Warning:  mysql_connect() [<a
> href='function.mysql-connect'>function.mysql-connect</a>]: [2002] A 
> connection attempt failed because the connected party did not  (trying 
> to connect via tcp://localhost:3306) in 
> C:\inetpub\wwwroot\old\index.php on line 29
> 
> I have search on the Internet for a solution for this but without any
luck.
> Any ideas?

Yes, first check that MySQL is actually listening on port 3306 ("Netstat"
should do that trick), and, if it is, try turning your firewall off.  What
is the value of $host?

KDK






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





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

-----Original Message-----
From: SED [mailto:s...@sed.is] 
Sent: Sunday, April 04, 2010 11:48 AM
To: 'SED'
Cc: php-gene...@lists.php.net
Subject: RE: [PHP] PHP (32 bit) on IIS7.5 and MySQL 5.1.45 (64 bit) ->
established connection failed because connected host has failed to respond

Hi Kevin,

Thank you for your assistance. I finally gave up and let my self to default
Microsoft Installation for IIS7.5+PHP+MySQL.

Everything runs fine on my developer machine - and that was my main goal -
so I'm fine.

However, after about 48 hours of search, I was not able to find to how to do
this manually - and it shock me (as a open source fan). At least, my Linuxs'
servers are still intact.

Ps. there is still snowing here in Iceland (heat -15°C in wind) and a
volcano eruption that is growing. :)

Thanks for your help,
Summi

-----Original Message-----
From: SED [mailto:s...@sed.is] 
Sent: 4. apríl 2010 10:06
To: 'Kevin Kinsey'
Cc: php-gene...@lists.php.net
Subject: RE: [PHP] PHP (32 bit) on IIS7.5 and MySQL 5.1.45 (64 bit) ->
established connection failed because connected host has failed to respond

Hi Kevin,

- MySQL 5.1 (64bit) is listening at port 0.0.0.0:3306
- MySQL 4.1 (32bit) is listening at port 0.0.0.0:3307
- When running MySQL command via PHP (CMD or browser) I get 127.0.0.1:3306
Established
- I can connect to MySQL via CMD or MySQL Administrator GUI.
- PHP (32bit) loads php_mysql.dll
- php.ini works 100%
- All Firewalls are disabled on LAN

- Is this a PHP bug or am I getting crazy? ;-)    
- Is there a 64bit of PHP who is assumed ok for develope machine with
firewalls?

Regards,
Summi

-----Original Message-----
From: Kevin Kinsey [mailto:k...@daleco.biz]
Sent: 4. apríl 2010 01:02
To: Sumarliði Einar Daðason
Cc: php-gene...@lists.php.net
Subject: Re: [PHP] PHP (32 bit) on IIS7.5 and MySQL 5.1.45 (64 bit) ->
established connection failed because connected host has failed to respond

Sumarliði Einar Daðason wrote:

> I have setup PHP (32 bit) on IIS7.5 and MySQL 5.1.45 (64 bit)  with
success.
> phpinfo() shows the MySQL extension loaded, but when I try to use 
> mysql_connect( $host, $user, $password ) in a PHP script I get 
> following
> error:
> 
> PHP Warning:  mysql_connect() [<a
> href='function.mysql-connect'>function.mysql-connect</a>]: [2002] A 
> connection attempt failed because the connected party did not  (trying 
> to connect via tcp://localhost:3306) in 
> C:\inetpub\wwwroot\old\index.php on line 29
> 
> I have search on the Internet for a solution for this but without any
luck.
> Any ideas?

Yes, first check that MySQL is actually listening on port 3306 ("Netstat"
should do that trick), and, if it is, try turning your firewall off.  What
is the value of $host?

KDK






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





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


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

I'm running a system with Fedora 12 and Apache/PHP default installation.
That means PHP is used as module in Apache, it is NOT running as CGI.

Nevertheless for the latest PHP version installed there
$_SERVER['PHP_AUTH_USER'], $_SERVER['PHP_AUTH_PW'] and
$_SERVER['REMOTE_USER'] do no longer work, they are empty and I get a
warning that they do not exist. It looks for me like a big incompatible
change from one version of PHP to an other (which is a mess).

So how can I get them back? Or what is the intended way to access the HTTP
Basic Auth username and password?

--- End Message ---
--- Begin Message ---
On 04/04/10 22:04, Satz Klauer wrote:
Hi,

I'm running a system with Fedora 12 and Apache/PHP default installation.
That means PHP is used as module in Apache, it is NOT running as CGI.

Nevertheless for the latest PHP version installed there
$_SERVER['PHP_AUTH_USER'], $_SERVER['PHP_AUTH_PW'] and
$_SERVER['REMOTE_USER'] do no longer work, they are empty and I get a
warning that they do not exist. It looks for me like a big incompatible
change from one version of PHP to an other (which is a mess).

So how can I get them back? Or what is the intended way to access the HTTP
Basic Auth username and password?


Why not dump the $_SERVER array and check it out ?

--
Nilesh Govindarajan
Site & Server Administrator
www.itech7.com
मेरा भारत महान !
मम भारत: महत्तम भवतु !

--- End Message ---
--- Begin Message ---
You can use, http://php.net/getallheaders function and parse the
authentication header.
For basic authentication, username and password are kept base64
encoded and separated by a ":"


Shiplu Mokaddim
My talks, http://talk.cmyweb.net
Follow me, http://twitter.com/shiplu
SUST Programmers, http://groups.google.com/group/p2psust
Innovation distinguishes bet ... ... (ask Steve Jobs the rest)



On Sun, Apr 4, 2010 at 10:19 PM, Satz Klauer <satzkla...@googlemail.com> wrote:
> Hi,
>
> I'm running a system with Fedora 12 and Apache/PHP default installation.
> That means PHP is used as module in Apache, it is NOT running as CGI.
>
> Nevertheless for the latest PHP version installed there
> $_SERVER['PHP_AUTH_USER'], $_SERVER['PHP_AUTH_PW'] and
> $_SERVER['REMOTE_USER'] do no longer work, they are empty and I get a
> warning that they do not exist. It looks for me like a big incompatible
> change from one version of PHP to an other (which is a mess).
>
> So how can I get them back? Or what is the intended way to access the HTTP
> Basic Auth username and password?
>

--- End Message ---
--- Begin Message ---
Satz Klauer wrote:
> Hi,
> 
> I'm running a system with Fedora 12 and Apache/PHP default installation.
> That means PHP is used as module in Apache, it is NOT running as CGI.
> 
> Nevertheless for the latest PHP version installed there
> $_SERVER['PHP_AUTH_USER'], $_SERVER['PHP_AUTH_PW'] and
> $_SERVER['REMOTE_USER'] do no longer work, they are empty and I get a
> warning that they do not exist. It looks for me like a big incompatible
> change from one version of PHP to an other (which is a mess).
> 
> So how can I get them back? Or what is the intended way to access the HTTP
> Basic Auth username and password?
> 

just a quick sanity check; you do have the specific site/directory set
up to send and receive basic auth yeah? sounds very much to me like this
is an apache config issue and not php :)

regards!

--- End Message ---
--- Begin Message ---
Sorry for the top-post. Easter has me on the DROID instead of my PC.

I second Rixham's thought. Is it a DSO, CGI, FCGI? What pops out in
var_dump($_SERVER) and var_dump($_ENV)?

On Apr 4, 2010 3:49 PM, "Nathan Rixham" <nrix...@gmail.com> wrote:

Satz Klauer wrote:
> Hi,
>
> I'm running a system with Fedora 12 and Apache/PHP default installatio...
just a quick sanity check; you do have the specific site/directory set
up to send and receive basic auth yeah? sounds very much to me like this
is an apache config issue and not php :)

regards!


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

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

I am trying send command to remote host over ssh with sockets. But I need to 
set up username/password. I am trying to modify this script (from www.php.net - 
function fsockopen), but I dont know, where set username/password because I got 
this message:
Bad protocol version identification 'password' from ip

Library ssh2 is not currentu userfull for me, because I am not admin of server.

Thank you
Radek


<?php
/************************************************************
* Author: Richard Lajaunie
* Mail : richard.lajau...@cote-azur.cci.fr
*
* subject : this script retreive all mac-addresses on all ports
* of a Cisco 3548 Switch by a telnet connection
*
* base on the script by: xbensemhoun at t-systems dot fr on the same page
**************************************************************/

if ( array_key_exists(1, $argv) ){
   $cfgServer = $argv[1];
}else{
   echo "ex: 'php test.php 10.0.0.0' \n";
   exit;
}

$cfgPort    = 23;                //port, 22 if SSH
$cfgTimeOut = 10;

$usenet = fsockopen($cfgServer, $cfgPort, $errno, $errstr), $cfgTimeOut);

if(!$usenet){
       echo "Connexion failed\n";
       exit();
}else{
       echo "Connected\n";
       fputs ($usenet, "password\r\n");
       fputs ($usenet, "en\r\n");
       fputs ($usenet, "password\r\n");
       fputs ($usenet, "sh mac-address-table\r\n");
       fputs ($usenet, " "); // this space bar is this for long output
     
       // this skip non essential text
       $j = 0;
       while ($j<16){
       fgets($usenet, 128);
       $j++;
       }
   stream_set_timeout($usenet, 2); // set the timeout for the fgets
   $j = 0;
       while (!feof($usenet)){
       $ret = fgets($usenet, 128);
       $ret = str_replace("\r", '', $ret);
       $ret = str_replace("\n", "", $ret);
       if  (ereg("FastEthernet", $ret)){
           echo "$ret \n";
       }
       if (ereg('--More--', $ret) ){
           fputs ($usenet, " "); // for following page
       }
       $info = stream_get_meta_data($usenet);
       if ($info['timed_out']) {
           $j++;
       }
       if ($j >2){
           fputs ($usenet, "lo");
           break;
       }
   }
}
echo "End.\r\n";
?>

--- End Message ---

Reply via email to