I observed that enabling the browscap.ini entry in the php-cli.ini file increases the startup time for php
[browscap]
browscap = /etc/browscap.ini
time php -r 'echo "Hello
";'
Hello
real 0m1.709s
user 0m1.358s
sys 0m0.348s
****VS the below****
[browscap]
;browscap = /etc/browscap.ini
time php -r 'echo "Hello
";'
Hello
real 0m0.041s
user 0m0.029s
sys 0m0.011s
Now I know that php looks up the browscap.ini file when a function like get_browser() is called. I can understand the lag if such a function is used.
I don't think php would be loading the browscap.ini(which can be large) data into memory on each startup. But why the huge delay in php startup ?
Maybe it tries to check if the browscap.ini file exists on every startup or some other validation ? Could not find anything in the php docs.
So why the huge difference in php startup times ?