cancel
Showing results for 
Search instead for 
Did you mean: 

My first Magento install on localhost producing errors in admin area

SOLVED

My first Magento install on localhost producing errors in admin area

I don't even have a login screen.  I get this error:  Parse error: syntax error, unexpected 'protected' (T_PROTECTED) in C:\xampp\htdocs\magento\vendor\magento\framework\View\Element\Template\File\Validator.php on line 163

 

Line 163 is:  

protected function getRootDirectory()
{
if (null === $this->directory) {
$this->directory = $this->_filesystem->getDirectoryRead(DirectoryList::ROOT);
}
return $this->directory;
}
}

 

Any help would be greatly appreciated, as I've found nothing with this particular error.  Thank you.

1 ACCEPTED SOLUTION

Accepted Solutions

Re: My first Magento install on localhost producing errors in admin area

Hi @sandra_sailer,

Please look into the below link.
There are some workaround, may be it will help you.

https://magento.stackexchange.com/questions/251924/invalid-template-file-magento2-3-0

View solution in original post

14 REPLIES 14

Re: My first Magento install on localhost producing errors in admin area

Hi @sandra_sailer,

Which PHP version and Magento version you are using?

Magento suggest PHP 7.2 for Magento 2.3.2.

For more info:

https://devdocs.magento.com/guides/v2.3/install-gde/system-requirements-tech.html

I hope it will help you!

Re: My first Magento install on localhost producing errors in admin area

Magento 2.3.2

PHP version: 7.1.9

 

Thanks. 

Re: My first Magento install on localhost producing errors in admin area

@sandra_sailer,

Did you enabled a2enmod on your server?

sudo a2enmod php7.1
sudo service apache2 restart

If still not work then you should try with PHP 7.2. Magento is fully tested on PHP 7.2.

I hope it will help you!

Re: My first Magento install on localhost producing errors in admin area

Hello @sandra_sailer ,

It is better that you should use php 7.2 instead of php 7.1 . 

Please check the magento devedocs for php requirements: 

https://devdocs.magento.com/guides/v2.3/install-gde/system-requirements-tech.html#php

Magento itself mentioned that "

Magento 2.3.1 is certified and tested on PHP 7.2.11."

If it helps you then please give us kudos and accept it as solution.

Thanks.

 

Re: My first Magento install on localhost producing errors in admin area

I was unable to upgrade from php 7.1 to 7.2.  So, I had to restore my backup copy.  

Re: My first Magento install on localhost producing errors in admin area

Please refer the below link https://askubuntu.com/questions/856793/upgrade-to-the-specific-php-7-1-7-2-from-php-7-0-in-ubuntu-16...

Note : Please use sudo apt-get install php7.2 in step 4th instead of sudo apt-get install php7.1

I hope it will help you to upgrade the php from 7.1 to 7.2

If still you face any error, please let us know the exact error so that we can check it.

Thank you.

Re: My first Magento install on localhost producing errors in admin area

I am running XAMPP on Windows 10, and have 7.1.9 currently installed.  These instructions wouldn't apply as it's Ubuntu, right? 

 

I found another thread with upgrade instructions which I will try on another computer as time permits.  I can't risk messing up my entire PHP install on my primary computer!  The first one didn't work, so I'm a bit hesitant to try it again on this system.

Re: My first Magento install on localhost producing errors in admin area

Sarvagya, this is the error I receive when I try to upgrade to PHP 7.2.21. Apache won't run/start, and then I have to restore the backup copy I made.

11:59:23 AM [Apache] Error: Apache shutdown unexpectedly.
11:59:23 AM [Apache] This may be due to a blocked port, missing dependencies,
11:59:23 AM [Apache] improper privileges, a crash, or a shutdown by another method.
11:59:23 AM [Apache] Press the Logs button to view error logs and check
11:59:23 AM [Apache] the Windows Event Viewer for more clues
11:59:23 AM [Apache] If you need more help, copy and post this
11:59:23 AM [Apache] entire log window on the forums

 

Re: My first Magento install on localhost producing errors in admin area

Hi @sandra_sailer,

Please look into the below link.
There are some workaround, may be it will help you.

https://magento.stackexchange.com/questions/251924/invalid-template-file-magento2-3-0