Problems, need help? Have a tip or advice? Post it here.
5 posts Page 1 of 1
Hello,

After upgrading PHP on my server (from 7.4 to 8.2), my CouchCMS site stopped working and displayed this error:

Fatal error: DISEVAL - Use of eval is forbidden in one of the CMS PHP files on line 1

The issue appears to be caused by the use of the `eval()` function, which is now commonly disabled in shared hosting environments for security reasons.

**Questions:**
- Is there an official or recommended way to replace `eval()` in this case?
- Has CouchCMS released an update or patch that removes `eval()` usage?
- What’s the best approach to remain compatible with hosting environments where `eval()` is disabled?

Any help or suggestions would be greatly appreciated.

Thanks!
Hello!
What version of CouchCMS are you currently using?

Please make sure to have the latest version of CouchCMS downloaded from Github.

The downloaded zip from the link above will contain the Upgrade instructions.

We have upgraded many sites from PHP 5 going upto PHP 8, on shared servers, but never faced this particular issue.

Regards,
GXCPL (CTR)
Image
where innovation meets technology
genxcoders wrote: Hello!
What version of CouchCMS are you currently using?

Please make sure to have the latest version of CouchCMS downloaded from Github.

The downloaded zip from the link above will contain the Upgrade instructions.

We have upgraded many sites from PHP 5 going upto PHP 8, on shared servers, but never faced this particular issue.

Regards,
GXCPL (CTR)


Hello genxcoders,

Just to clarify - I'm running CouchCMS version 2.4, downloaded from the official website (couchcms.com).

I recently tested the same site on two different shared hosting environments:

- **Server 1** (eval() enabled): CouchCMS runs perfectly.
- **Server 2** (eval() disabled by the hosting provider): CouchCMS throws this error:

> Fatal error: DISEVAL - Use of eval is forbidden in functions.php

It seems the issue is caused by this line in `functions.php`:

```php
return eval("return ".$s.";");


Thanks again for your time and support!
thanks for the confirmation and welcome.

But in this case as the issue is persistent, KK Sir would be the right person to help you out on this!

Regards,
GXCPL (CTR)
Image
where innovation meets technology
@siheng, the error suggests (as you correctly pointed out) that a security mod on the server, perhaps suhosin, is disallowing the eval function.

Unfortunately, there can be no workaround for this scenario, I am afraid.
Try requesting the host to lift this limitation for your particular site.
5 posts Page 1 of 1