Re: PHP testing - problem with php libraries loading

2005-11-30 Thread Chris Shiflett

Filin A. wrote:

But after I read your question I made an experiment
whith my system httpd.conf and php.ini and checked
phpinfo() output.

I've set the extension_dir in php.ini to the wrong
directory and assigned correct value in the
httpd.conf. It's strange but though phpinfo()
acknowledges my httpd.conf extension_dir as a
'Local Value', extensions are not loaded.


That rules out Apache-Test as the root cause of the problem. If I were 
trying to debug this, I'd very carefully compare the output of phpinfo() 
in an environment that works with the output of phpinfo() in an 
environment that doesn't.


Hope that helps.

Chris

--
Chris Shiflett
Brain Bulb, The PHP Consultancy
http://brainbulb.com/


Re: PHP testing - problem with php libraries loading

2005-11-28 Thread Geoffrey Young


Chris Shiflett wrote:
 Hi Filin,
 
 I've tride a lot of variants and I even think that

 IfModule @PHP_MODULE@
   php_admin_value extension_dir /usr/lib/php4/
 /IfModule

 _should_ work - but it doesn't! I don't know why :(
 (I tried both t/extra.conf.in and
 t/conf/extra.conf.in)
 
 
 The latter is the correct place.
 
 You might try getting rid of the conditional statement, just to see if
 that's the problem.

hmm, that's a good point.  t/conf/extra.conf.in only affects php tests that
run inside the server, such as t/response/TestAPI/foo.php.  if you're using
 t/foo.php-style tests then settings in t/conf/extra.conf.in don't apply.
guess we need to figure out how to do that...

--Geoff


Re: PHP testing - problem with php libraries loading

2005-11-27 Thread Chris Shiflett

Hi Filin,


I've tride a lot of variants and I even think that

IfModule @PHP_MODULE@
  php_admin_value extension_dir /usr/lib/php4/
/IfModule

_should_ work - but it doesn't! I don't know why :(
(I tried both t/extra.conf.in and
t/conf/extra.conf.in)


The latter is the correct place.

You might try getting rid of the conditional statement, just to see if 
that's the problem.


By the way, how are you testing to see whether this works? Is it the 
output of phpinfo()?



Oh. And can you please anyhow lead me at those links?


http://shiflett.org/apache-test-demo.tar.gz


Yes, I do like it. Actualy I'm rather fascinated by
the versality and power of your testing suit.


Very happy to hear this. :-) Hopefully we can help you get this problem 
solved.


Chris


Re: PHP testing - problem with php libraries loading

2005-11-25 Thread Filin A.
Hi. Sorry for not writing sooner and thanks for your
quick responce.

  1) Why it is necessary to have a special php.ini
for
  testing?
 
 say you have code that works one system and doesn't
work on another.  
 the problem turns out to be that your php.ini file
contains a crucial
 difference, but one you didn't think was crucial. 

I see...

 no, anything you need to override you can do locally
from 
 t/extra.conf.in,
 such as
 
 IfModule @PHP_MODULE
   php_extension_dir /usr/lib/php4/
 /IfModule
 

But I can't! I've tride a lot of variants and I even
think that

 IfModule @PHP_MODULE@
   php_admin_value extension_dir /usr/lib/php4/
 /IfModule

_should_ work - but it doesn't! I don't know why :(
(I tried both t/extra.conf.in and
t/conf/extra.conf.in)

 chris has links to the sample tarball where you can
see tricks like 
 this in action.  

Oh. And can you please anyhow lead me at those links?

 unfortunately we haven't had the free tuits to
document it as well
 as we would have liked.  but then again, nobody
seemed to be using the 
 php side of things but us.  so, welcome - we hope
you like it :)

Yes, I do like it. Actualy I'm rather fascinated by
the versality
and power of your testing suit.


__
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 


PHP testing - problem with php libraries loading

2005-11-19 Thread Filin A.
Hi all.

I'm trying to use Apache::Test module for testing my
php driven site
(Linux, Apache 2.0, PHP 4.3).

Everything works pretty good, but when I try to test a
php page which uses any
of mysql functions - the test fails and the error_log
contains these lines:

... 
PHP Warning:  Unknown(): Unable to load dynamic
library './mysql.so' - ./mysql.so: cannot open shared
object file: No such file or directory in Unknown on
line 0
PHP Warning:  Unknown(): Unable to load dynamic
library './xmlrpc.so' - ./xmlrpc.so: cannot open
shared object file: No such file or directory in
Unknown on line 0
...
[Client 127.0.0.1] PHP Fatal error:  Call to
undefined function:  mysql_connect() in
/home/filin/work-varavka/staff/htdocs/_inc/dbconnect.inc.php
on line 8
...

I think a line in the t/conf/php.ini:

extension_dir = ./

means that php seeks libraries in the current
directory, while those 
libraries are in the /usr/lib/php4/. Thereby I have 2
questions:
1) Why it is necessary to have a special php.ini for
testing?
2) How can I test (in a sane manner) php code with
functions from 
dynamic libraries?

I've tried to copy mysql.so in the current
directory, in all
meanings of current which I could imagine but
without any success.
I've successfully tried to modify the
Apache::TestConfigPHP 
so that it generates now
'extension_dir=/usr/lib/php4/',
but I don't think it is a good solving...


__
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 


Re: PHP testing - problem with php libraries loading

2005-11-19 Thread Geoffrey Young
cc'ing chris :)

 I think a line in the t/conf/php.ini:
 
   extension_dir = ./
 
 means that php seeks libraries in the current
 directory, while those 
 libraries are in the /usr/lib/php4/. 

hmm, could be.  chris would know better.

 Thereby I have 2
 questions:
 1) Why it is necessary to have a special php.ini for
 testing?

for the same reason that Apache-Test maintains all its own configuration
files, really - consistency, principle of least surprise, and so on.  think
of it like this...

say you have code that works one system and doesn't work on another.  the
problem turns out to be that your php.ini file contains a crucial
difference, but one you didn't think was crucial.  if your tests relied on
the installed php.ini file then you'd have the exact same problem on each
box when running the tests, on one box it would fail and on one box it would
pass.  this is Very Bad from a testing point of view - tests should create a
very specific environment in which to exercise your code, one where all the
variables are known.

using our own php.ini file (and own httpd.conf, etc) means that the
described circumstance would never happen - the tests would pass on both
systems letting you know immediately that your production environment is
_not_ the same as your testing environment.  and that is Good from a testing
point of view.

 2) How can I test (in a sane manner) php code with
 functions from 
 dynamic libraries?

I don't know the specifics, but to alter any php.ini setting you would
create t/conf/extra.conf.in and use a php variable to override the default
settings in php.ini

 
 I've tried to copy mysql.so in the current
 directory, in all
 meanings of current which I could imagine but
 without any success.
 I've successfully tried to modify the
 Apache::TestConfigPHP 
 so that it generates now
 'extension_dir=/usr/lib/php4/',
 but I don't think it is a good solving...

no, anything you need to override you can do locally from t/extra.conf.in,
such as

IfModule @PHP_MODULE
  php_extension_dir /usr/lib/php4/
/IfModule

or somesuch - I'm not really a php guy :)

chris has links to the sample tarball where you can see tricks like this in
action.  unfortunately we haven't had the free tuits to document it as well
as we would have liked.  but then again, nobody seemed to be using the php
side of things but us.  so, welcome - we hope you like it :)

--Geoff