Compare PHP settings of two different servers
Compare PHP settings of two different servers
am 23.07.2009 19:08:23 von Dave M G
PHP Gurus,
I'm currently having a problem with PHP writing text to a PNG image on
one server.
I have various web sites hosted on various servers, and on most of them,
the script that generates the image is writing text properly. I have
ensured that the same fonts are available on all the servers.
My first guess was that the PHP environment on the misbehaving server
was missing a GD module, like the TTF module or something. As far as I
can tell by looking over the phpinfo() settings, the servers have all
the same modules.
But maybe I'm just not seeing it, because manually going over the
settings is prone to human error.
Is there a way I can take the output of phpinfo() from both servers and
do a compare that will tell me what the differences are?
Alternatively, if anyone has any suggestions on what might be a cause of
not getting text onto an image, I'm open to any ideas.
Thanks for any advice.
--
Dave M G
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
Re: Compare PHP settings of two different servers
am 23.07.2009 19:17:00 von David Otton
2009/7/23 Dave M G :
> Is there a way I can take the output of phpinfo() from both servers and do a
> compare that will tell me what the differences are?
Just diff the HTML. WinMerge, Kompare, etc etc. Or probably built into
your favourite IDE.
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
Re: Compare PHP settings of two different servers
am 23.07.2009 19:17:02 von Robert Cummings
Dave M G wrote:
> PHP Gurus,
>
> I'm currently having a problem with PHP writing text to a PNG image on
> one server.
>
> I have various web sites hosted on various servers, and on most of them,
> the script that generates the image is writing text properly. I have
> ensured that the same fonts are available on all the servers.
>
> My first guess was that the PHP environment on the misbehaving server
> was missing a GD module, like the TTF module or something. As far as I
> can tell by looking over the phpinfo() settings, the servers have all
> the same modules.
>
> But maybe I'm just not seeing it, because manually going over the
> settings is prone to human error.
>
> Is there a way I can take the output of phpinfo() from both servers and
> do a compare that will tell me what the differences are?
>
> Alternatively, if anyone has any suggestions on what might be a cause of
> not getting text onto an image, I'm open to any ideas.
>
> Thanks for any advice.
In linux you would use the diff command to compare two files.
Cheers,
Rob.
--
http://www.interjinn.com
Application and Templating Framework for PHP
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
Re: Compare PHP settings of two different servers
am 23.07.2009 20:11:55 von Dave M G
David, Robert,
Thank you for replying.
> Just diff the HTML.
Unfortunately it is not that easy. Even if the same PHP modules are
present, if they are written into the page in a different place, they
show up as differences. The same goes for all the HTML tags and
everything else, so what I end up with is a ton of text, no more
streamlined or easy to analyze than the original output from phpinfo().
I'm hoping there's a way more targeted way of discerning what settings
one server may have that another server might not.
--
Dave M G
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
RE: Compare PHP settings of two different servers
am 23.07.2009 20:20:59 von Bob McConnell
From: Dave M G
> Thank you for replying.
>> Just diff the HTML.=20
>=20
> Unfortunately it is not that easy. Even if the same PHP modules are=20
> present, if they are written into the page in a different place, they=20
> show up as differences. The same goes for all the HTML tags and=20
> everything else, so what I end up with is a ton of text, no more=20
> streamlined or easy to analyze than the original output from
phpinfo().
>=20
> I'm hoping there's a way more targeted way of discerning what settings
> one server may have that another server might not.
Save each page to a text file.
Sort the two text files.
Run 'diff -iw' on the sorted files.
Add additional flags to diff as needed.
If you need more than that, you will probably have to write your own
utility to handle it.
You should also get copies of httpd.conf and php.ini from each server
and compare them. They will affect how some of those modules behave.
Bob McConnell
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
RE: Compare PHP settings of two different servers
am 23.07.2009 20:28:00 von Bob McConnell
From: Dave M G
> I'm currently having a problem with PHP writing text to a PNG image on
> one server.
>=20
> I have various web sites hosted on various servers, and on most of
them,=20
> the script that generates the image is writing text properly. I have=20
> ensured that the same fonts are available on all the servers.
Another thought comes to mind. What text encoding are you using and what
are the locale settings on those servers?
Bob McConnell
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
Re: Compare PHP settings of two different servers
am 23.07.2009 23:01:40 von Ben Dunlap
> Thank you for replying.
>> Just diff the HTML.
> Unfortunately it is not that easy. Even if the same PHP modules are
> present, if they are written into the page in a different place, they
> show up as differences. The same goes for all the HTML tags and
> everything else, so what I end up with is a ton of text, no more
> streamlined or easy to analyze than the original output from
> phpinfo().
Do you have shell access on these servers, and are they running Linux or the
like? If so, this seems like what you'd want:
php -i | sort -u
Ben
--
Twitter: @bdunlap
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
Re: Compare PHP settings of two different servers
am 25.07.2009 12:02:00 von Dave M G
Bob,
Thanks for replying.
> Another thought comes to mind. What text encoding are you using and what
> are the locale settings on those servers?
I try to ensure UTF-8 is the only encoding used, as much as possible.
Unfortunately, on the server that is misbehaving, it is the one where I
don't have shell access, so I'm limited in how much I can poke and prod
at its settings.
--
Dave M G
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
Re: Compare PHP settings of two different servers
am 05.08.2009 06:00:24 von Dave M G
Bob, Ben, David, Robert,
Thank you all for responding.
Just to recap, I'm trying to find out why I can write text into a PNG
image on one server, but not on another.
After much playing around, I have a list of the different configuration
modules installed on the two servers. The lists below are lists of the
modules *not* in common between them.
From what I can see, none of the modules that the behaving server have
that the misbehaving server doesn't has anything to do with fonts or
images. So my suspicion is starting to be that maybe the problem is not
in the PHP set up, but elsewhere.
Before I move on to other possible solutions, I'd like to double check
with more experienced eyes. Do any of the modules here affect text in
PNG files?
Misbehaving Server:
'--enable-ftp'
'--enable-magic-quotes'
'--enable-mbstring'
'--enable-pdo'
'--enable-soap'
'--enable-zip'
'--with-apxs2'
'--with-curl'
'--with-curl=/usr/local/lib'
'--with-freetype-dir=/usr/local/lib'
'--with-mcrypt'
'--with-mhash'
'--with-openssl'
'--with-pear'
'--with-pdo-mysql'
'--with-pdo-sqlite'
'--with-sqlite'
'--with-xmlrpc'
'--with-unixODBC=/usr'
Behaving Server:
'--disable-pdo'
'--enable-libxml'
'--prefix=/usr/local'
'--with-apxs2=/usr/local/apache/bin/apxs'
'--with-freetype-dir=/usr'
'--with-imap=/opt/php_with_imap_client/'
'--with-imap-ssl=/usr'
'--with-libxml-dir=/opt/xml2/'
'--with-mime-magic'
'--with-mysql-sock=/var/lib/mysql/mysql.sock'
'--with-xpm-dir=/usr/X11R6'
And, just to note, *both* servers have the following:
* '--with-gd'
* '--with-ttf'
* '--enable-gd-native-ttf'
--
Dave M G
http://tlug.jp/mediawiki/index.php?title=User:Dave_M_G
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
Re: Compare PHP settings of two different servers
am 05.08.2009 12:49:42 von Robert Cummings
Dave M G wrote:
> Bob, Ben, David, Robert,
>
> Thank you all for responding.
>
> Just to recap, I'm trying to find out why I can write text into a PNG
> image on one server, but not on another.
>
> After much playing around, I have a list of the different configuration
> modules installed on the two servers. The lists below are lists of the
> modules *not* in common between them.
>
>>From what I can see, none of the modules that the behaving server have
> that the misbehaving server doesn't has anything to do with fonts or
> images. So my suspicion is starting to be that maybe the problem is not
> in the PHP set up, but elsewhere.
>
> Before I move on to other possible solutions, I'd like to double check
> with more experienced eyes. Do any of the modules here affect text in
> PNG files?
>
> Misbehaving Server:
> '--enable-ftp'
> '--enable-magic-quotes'
> '--enable-mbstring'
> '--enable-pdo'
> '--enable-soap'
> '--enable-zip'
> '--with-apxs2'
> '--with-curl'
> '--with-curl=/usr/local/lib'
> '--with-freetype-dir=/usr/local/lib'
> '--with-mcrypt'
> '--with-mhash'
> '--with-openssl'
> '--with-pear'
> '--with-pdo-mysql'
> '--with-pdo-sqlite'
> '--with-sqlite'
> '--with-xmlrpc'
> '--with-unixODBC=/usr'
>
> Behaving Server:
> '--disable-pdo'
> '--enable-libxml'
> '--prefix=/usr/local'
> '--with-apxs2=/usr/local/apache/bin/apxs'
> '--with-freetype-dir=/usr'
> '--with-imap=/opt/php_with_imap_client/'
> '--with-imap-ssl=/usr'
> '--with-libxml-dir=/opt/xml2/'
> '--with-mime-magic'
> '--with-mysql-sock=/var/lib/mysql/mysql.sock'
> '--with-xpm-dir=/usr/X11R6'
>
> And, just to note, *both* servers have the following:
>
> * '--with-gd'
> * '--with-ttf'
> * '--enable-gd-native-ttf'
These are the command line arguments used to enable/disable extensions.
They don't guarantee that the extension is actually enabled though.
Check the extensions in phpinfo() output. Each properly enabled
extensions should have a little header. You are also trying to
manipulate a PNG file... I believe that relies on libpng-dev and may
require --with-png-dir=/usr/lib. I usually compile PHP myself so I'm not
sure what the defaults are for various distros.
Cheers,
Rob.
--
http://www.interjinn.com
Application and Templating Framework for PHP
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php