Community discussions

MikroTik App
 
marklodge
Member Candidate
Member Candidate
Topic Author
Posts: 250
Joined: Sun Jun 21, 2009 6:15 pm

Class 'Phar' not found in /home/sharedhost/mysite/PEAR2_Net_RouterOS-1.0.0b6.phar on line 18

Fri Aug 10, 2018 10:10 pm

Hi
I have everything working fine on my local xampp install. I uploaded it to my shared hosting package and I get the following error:
 PHP Fatal error:  Class 'Phar' not found in /home/sharedhost/mysite/PEAR2_Net_RouterOS-1.0.0b6.phar on line 18
 
User avatar
boen_robot
Forum Guru
Forum Guru
Posts: 2400
Joined: Thu Aug 31, 2006 4:43 pm
Location: europe://Bulgaria/Plovdiv

Re: Class 'Phar' not found in /home/sharedhost/mysite/PEAR2_Net_RouterOS-1.0.0b6.phar on line 18

Fri Aug 10, 2018 11:31 pm

For some reason your shared host doesn't have the Phar extension, which is required to open PHAR files. It may be using PHP 5.2 or earlier, where Phar was not enabled by default, or it may be disabled by the host for some reason.

If the problem is 5.2, there's no workaround - find a different host with PHP 5.3 or greater.

If the problem is that it's disabled, what you can do is use one of the other two archives - zip or tgz. Extract it, upload the folder to your shared host, and in your project, include the "src/PEAR2/Autoload.php" file instead of the PHAR file.

Or you could contact your host, and ask them to enable the Phar extension and Phar class... Though I find it unlikely for them to enable it on request, as shared hosts are notorious for not doing such things.
 
marklodge
Member Candidate
Member Candidate
Topic Author
Posts: 250
Joined: Sun Jun 21, 2009 6:15 pm

Re: Class 'Phar' not found in /home/sharedhost/mysite/PEAR2_Net_RouterOS-1.0.0b6.phar on line 18

Sat Aug 11, 2018 11:27 am

For some reason your shared host doesn't have the Phar extension, which is required to open PHAR files. It may be using PHP 5.2 or earlier, where Phar was not enabled by default, or it may be disabled by the host for some reason.

If the problem is 5.2, there's no workaround - find a different host with PHP 5.3 or greater.

If the problem is that it's disabled, what you can do is use one of the other two archives - zip or tgz. Extract it, upload the folder to your shared host, and in your project, include the "src/PEAR2/Autoload.php" file instead of the PHAR file.

Or you could contact your host, and ask them to enable the Phar extension and Phar class... Though I find it unlikely for them to enable it on request, as shared hosts are notorious for not doing such things.
Thank you, it was disabled. I managed to enable it from cPanel. For anyone else who has the same issue, here is a screenshot to help
phar.PNG
You do not have the required permissions to view the files attached to this post.

Who is online

Users browsing this forum: zjobra0013 and 30 guests