SitePoint Sponsor

User Tag List

Results 1 to 8 of 8
  1. #1
    SitePoint Addict
    Join Date
    Feb 2003
    Location
    Berlin
    Posts
    370
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Question get_browser() problem

    Hi,

    I would like to use the get_browser() function.

    So I downloaded the php_browscap.ini at http://browsers.garykeith.com/downloads.asp and pointed to it in my php.ini.

    But as soon as I try to use the get_browser() function, i.e.

    PHP Code:
    $browser get_browser(nulltrue); 
    the browser either returns a white page (Opera), downloads the page as empty file (FireFox) or informs me that the connection to the server has been unexpectedly disconnected (Safari).

    Any idea what the error could be?


    Thanks,
    Fl÷zen

  2. #2
    Unobtrusively zen silver trophybronze trophy
    paul_wilkins's Avatar
    Join Date
    Jan 2007
    Location
    Christchurch, New Zealand
    Posts
    14,526
    Mentioned
    83 Post(s)
    Tagged
    3 Thread(s)
    You'll need to restart the php server so that it can reread the ini file.
    Programming Group Advisor
    Reference: JavaScript, Quirksmode Validate: HTML Validation, JSLint
    Car is to Carpet as Java is to JavaScript

  3. #3
    SitePoint Addict
    Join Date
    Feb 2003
    Location
    Berlin
    Posts
    370
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thats not the problem. I have already restarted the server.

    The local value for my info.php file shows
    browscap /srv/www/vhosts/myseerver.com/conf/php_browscap.ini
    correctly.

  4. #4
    Unobtrusively zen silver trophybronze trophy
    paul_wilkins's Avatar
    Join Date
    Jan 2007
    Location
    Christchurch, New Zealand
    Posts
    14,526
    Mentioned
    83 Post(s)
    Tagged
    3 Thread(s)
    You can use phpinfo() to check the current settings for browscap

    Does the conf folder have the correct owner and permissions for php to access it?

    What do the error logs show for apache and php regarding this?
    Programming Group Advisor
    Reference: JavaScript, Quirksmode Validate: HTML Validation, JSLint
    Car is to Carpet as Java is to JavaScript

  5. #5
    SitePoint Addict
    Join Date
    Feb 2003
    Location
    Berlin
    Posts
    370
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    The apache error log shows:

    [Fri Feb 12 15:11:46 2010] [notice] child pid 5643 exit signal Segmentation fault (11)
    [Fri Feb 12 15:11:46 2010] [notice] child pid 5700 exit signal Segmentation fault (11)
    [Fri Feb 12 15:11:46 2010] [notice] child pid 5701 exit signal Segmentation fault (11)

    The php error log does not record anything on this event...?!

    The file has following permisions:
    -rw-r--r-- 1 myusername psacln 339908 Feb 12 11:56 php_browscap.ini

  6. #6
    Unobtrusively zen silver trophybronze trophy
    paul_wilkins's Avatar
    Join Date
    Jan 2007
    Location
    Christchurch, New Zealand
    Posts
    14,526
    Mentioned
    83 Post(s)
    Tagged
    3 Thread(s)
    That type of crash is what used to happen with get_browser when running on PHP3
    Programming Group Advisor
    Reference: JavaScript, Quirksmode Validate: HTML Validation, JSLint
    Car is to Carpet as Java is to JavaScript

  7. #7
    SitePoint Addict
    Join Date
    Feb 2003
    Location
    Berlin
    Posts
    370
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by pmw57 View Post
    That type of crash is what used to happen with get_browser when running on PHP3
    Hmm, on my server PHP version 5.2.11 is running.

  8. #8
    Unobtrusively zen silver trophybronze trophy
    paul_wilkins's Avatar
    Join Date
    Jan 2007
    Location
    Christchurch, New Zealand
    Posts
    14,526
    Mentioned
    83 Post(s)
    Tagged
    3 Thread(s)
    There may-well be a bug relating to the null parameter.
    Try feeding it an actual user agent string and see how that goes.
    Programming Group Advisor
    Reference: JavaScript, Quirksmode Validate: HTML Validation, JSLint
    Car is to Carpet as Java is to JavaScript


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •