|
Posted by "Richard Lynch" on 10/07/05 23:08
On Fri, October 7, 2005 2:54 pm, Jadel Menard wrote:
>
> I have an email validation script written in PHP that works on most
> Apache machines I try it on, with the exception (of course) of my
> production
> box that it needs to go on. This production machine is a Slackware
> 10.2 box,
> running Apache 1.33 and PHP 4.4.0.
>
> The script works if I call it from the command line with "php -f
> filename" however, if I try to call the same script from a browser
> (served by
> httpd) the DNS check is never made, and the script returns that the
> domain of
> the email address is invalid.
>
> The httpd people tell me that once Apache calls a .php page, PHP
> handles the actual parsing of that page, so if these DNS queries
> aren't
> happening when the page is called through a browser, what is changing
> from
> when they are called from the command line?
You'd first have to show us the source code that does the email checks.
In addition, see if you can dig out the httpd.conf and php.ini that
are used on the production server, and post links to them, after
removing any data you consider sensitive.
There's no rule that the PHP binary they have laying around on the
machine for command line use has to have any real correspondence with
the (presumed) PHP Module they have loaded into Apache.
They could be different versions of PHP, with entirely different
compile-time switches, and have nothing more than "PHP" in their name
in common.
They are USUALLY very similar, but a host could easily dis-allow
certain functions in php.ini in the web environment, but your CLI PHP
can easily not be using that same php.ini, and then you get the
functions they don't want you to have.
Worst-case scenario, you could probably use http://php.net/exec in
your web PHP script to fire up PHP command line to run your DNS lookup
script.
This is a total hack and will have HORRIBLE performance penalties.
And if the real "problem" is that your host doesn't want you doing DNS
lookups in the first place, so they disabled the function in php.ini,
they're not gonna be happy to find you doing this...
Extreme Caution is called for.
--
Like Music?
http://l-i-e.com/artists.htm
Navigation:
[Reply to this message]
|