• DevOps
    Case Study

    How we helped a development company rebuild DevOps for efficiency and scale.

    READ CASESTUDY
    icon

    24/7 DevOps as a Service

    Round-the-clock DevOps for uninterrupted efficiency.

    icon

    Infrastructure as a Code

    Crafting infrastructure with ingenious code.

    icon

    CI/CD Pipeline

    Automated CI/CD pipeline for seamless deployments.

    icon

    DevSecOps

    Integrated security in continuous DevOps practices.

    icon

    Hire DevOps Engineers

    Level up your team with DevOps visionaries.

    icon

    Consulting Services

    Navigate success with expert DevOps consulting.

  • TechOps
    Case Study

    How a US hosting leader scaled with us!

    READ CASESTUDY

    WEB HOSTING SUPPORT

    icon

    HelpDesk Support

    Highly skilled 24/7 HelpDesk Support

    icon

    Product Support

    Boost your product support with our expertise.

    MANAGED SERVICES

    icon

    Server Management

    Don’t let server issues slow you down. Let us manage them for you.

    icon

    Server Monitoring

    Safeguard your server health with our comprehensive monitoring solutions.

    STAFF AUGMENTATION

    icon

    Hire an Admin

    Transform your business operations with our expert administrative support.

    icon

    Hire a Team

    Augment your workforce with highly skilled professionals from our diverse talent pool.

  • CloudOps
    Case Study

    How we helped a Private Deemed University in India, save US $3500/m on hosting charges!

    READ CASESTUDY
    icon

    AWS Well Architected Review

    Round-the-clock for uninterrupted efficiency

    icon

    Optimize

    Efficient CloudOps mastery for seamless cloud management

    icon

    Manage

    Automated CI/CD pipeline for seamless deployments

    icon

    Migrate

    Upgrade the journey, Migrate & Modernize seamlessly

    icon

    Modernize

    Simplify compliance complexities with our dedicated services

    icon

    FinOps as a Service

    FinOps as a Service

  • SecOps
    Case Study

    Enabling financial grade platforms through strategic cloud modernisation.

    READ CASESTUDY
    icon

    VAPT

    Vulnerability Assessment and Penetration Testing

    icon

    Source Code Review

    Ensuring source code security ans safe practices to reduce risks

    icon

    Security Consultation

    On demand services for improving server security

    icon

    System Hardening

    Reduced vulnerability and proactive protection

    icon

    Managed SoC

    Monitors and maintains system security. Quick response on incidents.

    icon

    Compliance as a Service

    Regulatory compliance, reduced risk

  • Insights
    Case Study

    How we helped a Private Deemed University in India, save US $3,500/m on hosting charges!

    READ CASESTUDY
    icon

    Blog

    Explore our latest articles and insights

    icon

    Case Studies

    Read about our client success stories

    icon

    Flipbook

    Explore our latest Flipbook

    icon

    Events

    Join us at upcoming events and conferences

    icon

    Webinars

    Watch our educational webinar series

  • Our Story
  • Contact Us

Interested to collaborate?

Get in touch with us!

Ready to elevate your business with certified cloud expertise? Contact us today to learn how our team can help you leverage cloud technology to drive growth, streamline operations, and enhance security.

  • AWSAWS
  • Azure CloudAzure Cloud
  • Google CloudGoogle Cloud
  • Akamai CloudAkamai Cloud
  • OVHOVH
  • Digital OceanDigital Ocean
  • HetznerHetzner
  • Managed Services Overview
  • Kubernetes Consulting
  • DevOps as a Service
  • Infrastructure Monitoring
  • Kubernetes Consultancy Services
  • K8s & Cloud native Solutions
  • 24/7 Infrastructure Monitoring
  • DevOps as a Service
  • Cloud CI/CD Solutions
  • White Labeled MSP Support
  • Our story
  • Life@SupportSages
  • Insights
  • Careers
  • Events
  • Services
  • Managed Services

aws partneraws advanced partner
LinkedInFacebookXInstagramYouTube
SupportSages

Copyright © 2008 – 2026 SupportSages Pvt Ltd. All Rights Reserved.
Privacy PolicyLegal TermsData ProtectionCookie Policy

Enabling Browscap extension to PHP (Cloud Linux Environment)

Author Profile
Vipin R.N
  • 4 min read
Enabling Browscap extension to PHP (Cloud Linux Environment)

Generating audio, please wait...

The Client was trying to get Browser information of his site visitors using get_browser() function, but it didn’t work. Let us see how to fix the issue with browscap php extension

Browscap :

Browser Capabilities Project. Used to obtain Browser information and related statistics of Visitors to a website. The Native code used for this is :

<?php
$browser = get_browser();
print_r($browser);
?>

Browscap is an advanced extension of HTTP Environment Variable HTTP_USER_AGENT

Background Information
The issue was with the Browscap PHP extension. It was not available in the server. The server is running on CloudLinux, so things are quite different here in terms of PHP. CloudLinux has several features, PHP Selector is one among it. With the aid of PHP Selector, cPanel users can switch to PHP versions 5.2, 5.3, 5.4, 5.5 and other (native) versions if included in its configuration. Hence, the native location for PHP (in cPanel servers) at /usr/local/lib/php is not used in CloudLinux environment.

CloudLinux

A smart range of Installation / Configuration docs are available here as well.

Prelude
With reference to this topic it is possible to compile PHP extensions as we prefer. But Browscap PHP extension is not actually an extension that has to be configured. The library files were already available, we just had to know how to include it in the PHP configuration.

Following are the important file locations in CloudLinux environment for PHP :

File Location
PHP 5.x /opt/alt/php5x/
PHP 5.x Binary files /opt/alt/php5x/usr/bin/
PHP 5.x Binary (CLI) /opt/alt/php5x/usr/bin/php
PHP 5.x Binary (CGI)  /opt/alt/php5x/usr/bin/php-cgi
 PHP 5.x Configuration  /opt/alt/php5x/etc/php.ini
PHP 5.x Configuration (Extensions)  /opt/alt/php52/etc/php.d.all/
PHP 5.x Modules /opt/alt/php5X/usr/lib64/php/modules/

 

* Replace x with appropriate version, for instance php52/php53/php54

Fix
The fix is quite simple. Download the Browscap configuration file from here and move it to /opt/alt/php5x/etc/php.d.all. Further edit the PHP configuration file /opt/alt/php5x/etc/php.ini and uncomment the following line :

[browscap]

;browscap = extra/browscap.ini

to

[browscap]

browscap = /opt/alt/php5x/etc/php.d.all/browscap.ini

Save the file. Please note that you will have to do this for all PHP versions if it has to be made available globally.

Finally, restart CageFS parameters :

cagefsctl --rebuild-alt-php-ini

cagefsctl --force-update 

Test the PHP Code given earlier, it should give you the output like this

Detecing Browser … stdClass Object ( [browser_name_regex] => ^mozilla/5\.0 (.*linux i686.*).*gecko/.*firefox/.*$ [browser_name_pattern] => Mozilla/5.0 (*Linux i686*)*Gecko/*Firefox/* [parent] => Firefox Generic [platform] => Linux [win32] => [comment] => Firefox Generic [browser] => Firefox [alpha] => 1 [frames] => 1 [iframes] => 1 [tables] => 1 [cookies] => 1

=> 1 [javaapplets] => 1 [cssversion] => 3 [version] => 0.0 [majorver] => 0 [minorver] => 0 [platform_version] => unknown [beta] => [win16] => [win64] => [backgroundsounds] => [vbscript] => [activexcontrols] => [ismobiledevice] => [issyndicationreader] => [crawler] => [aolversion] => 0 )

 

  • Howtos
  • Linux

“Suspended Page ” defaced in cPanel Server

“Suspended Page ” defaced in cPanel Server
  • cPanel
  • Linux
  • Troubleshooting
logo

APC Cache Activation and disable XCache

APC Cache Activation and disable XCache
  • Apache
  • cPanel
  • Linux
logo

Blacklisted ? Switch your Mail Server IP

Blacklisted ? Switch your Mail Server IP
  • cPanel
  • Linux
  • Webmail
logo

Chapter 12 All about a process running in linux

Chapter 12 All about a process running in linux
  • General
  • Howtos
  • Linux
  • Special Offers
  • Training
  • Troubleshooting
logo
Enabling Browscap extension to PHP (Cloud Linux Environment)

Posts by Vipin R.N

Vipin is a no-nonsense, disciplined guy who ensures that everything is carried out with the highest level of perfection. Apart from his great coding skills, he is quite interested in advanced server administration, issue analysis, documentation and training. In-depth knowledge in international politics, ammunition and automobiles makes this hard core Manchester United fan, one of the most referenced personalities in the entire team.