Error: dirname() expects exactly 1 parameter, 2 given

You are here:
< All Topics

If you get the following error on install:

Warning: dirname() expects exactly 1 parameter, 2 given in:/xxx/34363464/YOURWEBSITE/wp-content/plugins/wp-product-advisor-pro/inc/Base/BaseController.php?on line:32

your PHP version most likely is outdated. The WP Product Advisor needs the latest PHP version 7 or higher, which you can set with your web host.

Why should i update to PHP 7

1. Speed and Performance

If your site is running on an older version of PHP, upgrading to the latest version will immediately boost performance – more than optimizing the edges of your WordPress site.

When PHP 7.0 was released, it was widely praised for its significant performance gains. Indeed, official PHP benchmarking with WordPress 4.1.1 shows that PHP 7.0 servers can execute twice as many requests per second as PHP 5.6 does at less than half the latency.

2. Support and compatibility

Compatibility is another important reason why you want to work with the latest version of PHP. Like any software, developers only support older versions for a limited time.

For example, older versions of iPhones are not compatible with the latest version of iOS, rendering them virtually useless. This is because active support of legacy software and backward compatibility are costly, especially in terms of plug-in and theme developer time.

You want to provide their products with new features, as well as security and performance improvements. Supporting older versions of PHP keeps you from doing that.

3. Security

Another reason why you should upgrade is the security of your WordPress site. Running the latest version of PHP ensures that your site is protected from vulnerabilities found in older versions of PHP.

For example, here’s a sneak peek: According to CVE Details, a data source for vulnerabilities, 18 known vulnerabilities have been found in PHP this year. 43 vulnerabilities were discovered in 2017 and 107 vulnerabilities were found in 2016.

These vulnerabilities include DoS, code execution, SQL injection, XSS, and many other types of exploits.