Page 1 of 1

auto_prepend in php.ini

Posted: Wed Nov 15, 2006 9:19 am
by AngryPanda
Hi, I would like a script to be run before every page load. I know that's what the auto_prepend_file setting is for, but I simply can't get it to work. Can someone enlighten me as to what I need to do exactly? I've tried with quotes, without quotes, full path, relative path, changing the include_path settings in the ini, tried using .htaccess to do all this instead, but I can't get anything to work. I'm using php5, apache2.2.3 and I'm on windows. Thanks.

Posted: Wed Nov 15, 2006 11:31 am
by volka
If php is installed as apache module you have to restart apache after you've changed settings in php.ini
<?php phpinfo(); ?> tells you which php.ini you have to edit.
The restart the webserver and check <?php phpinfo(); ?> again to see wether it reflects your changes.

Posted: Wed Nov 15, 2006 2:24 pm
by AngryPanda
Thanks ! Turned out I was indeed editing the wrong php.ini... the machine I'm working on is now using xampp which apparently its services trumped the configuration I had. Damn shared computers. Anyway, thanks again.