Bobcares

proc_open Laravel error – Fix it without compromising server security

by | Mar 16, 2020

Oops! Is your Laravel website showing proc_open function unavailable error?

The proc_open is a PHP parameter used to execute the command and open file pointers.

Usually, server owners disable this function due to security risk as it allows external calls.

At Bobcares, customers often approach us to fix Laravel errors, as a part of our Server Management Services.

Today, we’ll see how our Support Engineers fix the proc_open error in Laravel.

 

The proc_open function and Laravel

Laravel is an open-source PHP web framework. This development tool makes the task of website development easier. This is because its code is simple and clean.

It uses many PHP functions in its code for various functionalities. One such PHP function is proc_open. This function executes a command and open file pointers for I/O.

But in most servers, the proc_open function will be disabled due to security risk. This function allows external calls that attackers may utilize. But if Laravel websites use this function at any point, it throws errors.

Recently one of our customers approached us with a proc_open error in Laravel. The error message appeared as,

proc_open Laravel

Our Support Engineers had a closer look at the customer’s server. The customer had a cPanel account in the CloudLinux server with CageFS enabled in it. So to fix the error we have to either enable the proc_open function or avoid using this function.

Next, let’s see how to do this.

 

How to fix the proc_open error in Laravel?

Due to security concerns, the proc_open function in a server is usually disabled. Our Support Engineers always look if the function has critical importance in the working of the website. If yes, we enable it after ensuring the server security.

Let’s see two instances where we fixed the error.

 

For a cPanel account

The customer had a cPanel account in a shared hosting server. So before enabling the proc_open function server-wide, we lookout for the security of other customers in the server too.

But for this customer, we enabled it after looking at the security measures available in the server. Here are the steps we did to enable the proc_open function.

  • First, we login to the cPanel account of the customer.
  • Next, we selected the PHP version that Laravel uses. Here it was 7.2.
  • We also selected PHP versions that were not native.
  • Then we clicked on Switch to PHP Options on the top-right.
  • Later, we added and edited the disabled_function directive. This way, we enabled the proc_open here.

Here we didn’t enable the proc_open function server-wide, rather we enabled it for a single cPanel account. Also, since the server had CageFS enabled, it reduces security risks in the server.

 

In other shared hosting servers

Enabling the proc_open function server-wide may not acceptable due to security risks. So if the error showed up in a shared hosting server, we recommend our customers to avoid using the function.

Usually, a default Laravel application will not require proc_open() to serve a site. Rather users use it debugging mode for enabling Flare error reporting service. So we publish the flare config file,

php artisan vendor:publish --tag=flare-config

And edit the config/flare.php. Here we set the following parameter false.

'collect_git_information' => false

Hence the application will not use proc_open function.

 

[Still, having trouble in fixing Laravel errors? – We can help you.]

 

Conclusion

In short, Laravel is a PHP based web application tool that uses a lot of PHP functions like proc_open. Today, we saw how our Support Engineers enable this function after looking at the security of the server.

PREVENT YOUR SERVER FROM CRASHING!

Never again lose customers to poor server speed! Let us help you.

Our server experts will monitor & maintain your server 24/7 so that it remains lightning fast and secure.

GET STARTED

var google_conversion_label = "owonCMyG5nEQ0aD71QM";

1 Comment

Submit a Comment

Your email address will not be published. Required fields are marked *

Never again lose customers to poor
server speed! Let us help you.

Privacy Preference Center

Necessary

Necessary cookies help make a website usable by enabling basic functions like page navigation and access to secure areas of the website. The website cannot function properly without these cookies.

PHPSESSID - Preserves user session state across page requests.

gdpr[consent_types] - Used to store user consents.

gdpr[allowed_cookies] - Used to store user allowed cookies.

PHPSESSID, gdpr[consent_types], gdpr[allowed_cookies]
PHPSESSID
WHMCSpKDlPzh2chML

Statistics

Statistic cookies help website owners to understand how visitors interact with websites by collecting and reporting information anonymously.

_ga - Preserves user session state across page requests.

_gat - Used by Google Analytics to throttle request rate

_gid - Registers a unique ID that is used to generate statistical data on how you use the website.

smartlookCookie - Used to collect user device and location information of the site visitors to improve the websites User Experience.

_ga, _gat, _gid
_ga, _gat, _gid
smartlookCookie
_clck, _clsk, CLID, ANONCHK, MR, MUID, SM

Marketing

Marketing cookies are used to track visitors across websites. The intention is to display ads that are relevant and engaging for the individual user and thereby more valuable for publishers and third party advertisers.

IDE - Used by Google DoubleClick to register and report the website user's actions after viewing or clicking one of the advertiser's ads with the purpose of measuring the efficacy of an ad and to present targeted ads to the user.

test_cookie - Used to check if the user's browser supports cookies.

1P_JAR - Google cookie. These cookies are used to collect website statistics and track conversion rates.

NID - Registers a unique ID that identifies a returning user's device. The ID is used for serving ads that are most relevant to the user.

DV - Google ad personalisation

_reb2bgeo - The visitor's geographical location

_reb2bloaded - Whether or not the script loaded for the visitor

_reb2bref - The referring URL for the visit

_reb2bsessionID - The visitor's RB2B session ID

_reb2buid - The visitor's RB2B user ID

IDE, test_cookie, 1P_JAR, NID, DV, NID
IDE, test_cookie
1P_JAR, NID, DV
NID
hblid
_reb2bgeo, _reb2bloaded, _reb2bref, _reb2bsessionID, _reb2buid

Security

These are essential site cookies, used by the google reCAPTCHA. These cookies use an unique identifier to verify if a visitor is human or a bot.

SID, APISID, HSID, NID, PREF
SID, APISID, HSID, NID, PREF