2


I'm trying to learn e-commerce solution development and because magento has huge community all around the globe as well as it's scalability with extensions and all other I planned working on Magento.
I have downloaded the community package from the magento website and trying to run the following on XAMPP on my OSX .

It is running PHP v 7.0.8

When I'm trying to run the same I get the following error

Fatal error: Interface 'Zend\Stdlib\JsonSerializable' not found in /Applications/XAMPP/xamppfiles/htdocs/proj/magento/vendor/magento/framework/Phrase.php on line 14

I do understand that the following is missing from my system.
Hence I looked up for the solution and found to upgrade the php version but I'm already using 7.0.8 also there's someone who says to composer install

But none of the above helped me so I tried to download the Zend-stdlib from github and pasted the same under Vendor folder as per the path in the error.
It didn't help either.

If anyone can suggest me something else or point me to the correct direction that would be really helpful.

EDIT 1

The files that I have downloaded from the magento website is kept under a subfolder named proj within htdocs. The proj folder holds all the folder that has been downloaded as it is.

EDIT 2

I have also tried running the files using MAMP PRO and kept the magento >folder as the main directory. Yet it won't help. Now I tried to run Composer install I got this error `composer install Loading composer repositories with package information Installing dependencies (including require-dev) from lock file Your requirements could not be resolved to an installable set of packages.

  Problem 1
    - magento/framework 100.1.0 requires ext-mcrypt * -> the requested PHP extension mcrypt is missing from your system.
    - magento/framework 100.1.0 requires ext-mcrypt * -> the requested PHP extension mcrypt is missing from your system.
    - Installation request for magento/framework 100.1.0 -> satisfiable by magento/framework[100.1.0].

EDIT 3

As per my understanding the above error occurred because MAMP is running PHP v 7.0.8 which is not same as my system PHP V.
Thus I have modified my >system PHP to MAMP php version by setting the path using the following >commands

sudo nano ~/.bash_profile
PATH="/Applications/MAMP/bin/php/php5.6.7/bin:$PATH"

Now the system has PHP V 7.0.8.
After this I have tried composer install >and it throws the following error

Loading composer repositories with package information
Installing dependencies (including require-dev) from lock file
Nothing to install or update
Package fabpot/php-cs-fixer is abandoned, you should avoid using it. Use      friendsofphp/php-cs-fixer instead.
Generating autoload files


  [RuntimeException]                                                           
  Could not scan for classes inside "/Applications/MAMP/htdocs/magento/vendor  
  /oyejorge/less.php/lessc.inc.php" which does not appear to be a file nor a   
  folder                                                                       


install [--prefer-source] [--prefer-dist] [--dry-run] [--dev] [--no-dev] [--no-custom-installers] [--no-autoloader] [--no-scripts] [--no-progress] [--no-suggest] [-v|vv|vvv|--verbose] [-o|--optimize-autoloader] [-a|--classmap-authoritative] [--ignore-platform-reqs] [--] [<packages>]...

It throws a runtime exception.

SOLVED

After struggling so much, I have planned starting from scratch and instead of downloading the files from the Magento website I got the files from Magento Github repo magento2, paste it n the htdocs directory and run composer install. All seem to be working fine now.

  • Is Magento in the main root or into a "magento" subfolder? – Enzo Perrotta Aug 28 '16 at 19:07
  • @EnzoPerrotta Please check my question I have edited the same. – silverFoxA Aug 29 '16 at 8:14
  • The Zend library should be in your composer.lock file. Try running composer update followed by composer install, this should place JsonSerializable in vendor/zendframework/zend-stdlib/src/JsonSerializable.php, at least I do not see why it would not. If it does not, please post your composer terminal logs and upload your composer.lock file so we can have a look if everything in there is fine. – TiEul Aug 29 '16 at 9:07
  • @TiEul Please check the updated question EDIT 2 – silverFoxA Aug 29 '16 at 9:09
0

You are missing the mcrypt extension and that's why your Composer install fails. Try running:

brew install php70-mcrypt

If you do not have Brew, have a look at their website and get it.

Once that is done, try running composer install again, if it does not work please provide the terminal logs from Composer and Brew (though obviously you should properly read and try to understand them yourself first).

  • Please check my updated question – silverFoxA Aug 29 '16 at 9:31
  • Weird issue, you should try removing the vendor directory altogether and then run composer update followed by composer install again, something is messed up but at least your dependency problems seems to have been resolved. – TiEul Aug 29 '16 at 15:14
  • I'm not sure what was the problem though but making fresh download from github seems to be the solution in my case – silverFoxA Aug 29 '16 at 16:00
  • There was probably something corrupt about the directory in question and after downloading it again the problem did not exist anymore (same applies to the missing mcrypt extension). In any case, you should be relying on Composer when working with Magento 2, especially the vendor directory should not be touched manually and only through Composer. – TiEul Aug 29 '16 at 16:05

Not the answer you're looking for? Browse other questions tagged or ask your own question.