1

Me and a friend of mine are working with a project. She was responsible for a part of it, while I would add some functionalities to her code. So she send me her code and I should make it work in my machine and add my part. However, I'm facing this problem. She has used yaml in the project (which I had no idea it existed before, I don't do web programming, only algorithm implementation). I tried to follow her instructions but got stuck at

  Fatal error: Call to undefined function yaml_parse_file() in /var/www/html/cdn/map_of_site.php on line 8

So I thought that I should install the yaml library (which I think I did correctly). I also added the yaml parser in the php.ini But the error continues to appear.

The worst part is that I won't be able to get in touch with her for a couple of days (and I kind of dislike telling her that I don't know how to make her code work).

Could you please tell me in general what is required to make a project that uses yaml_parse_file() function work? Like what should I install or where to install it ...

PS: I work with linux mint and the project is php

jwodder
  • 54,758
  • 12
  • 108
  • 124
Lazarus Rising
  • 2,597
  • 7
  • 33
  • 58

2 Answers2

0

Your frend used a php module that you don't have installed or enabled. You can try to install it in the regular way (I don't know linux mint myself): - apt-get install php5-yaml - yum install php5-yaml Or something like that.

If yaml is not available like that, you can try to use pecl. You need this package: http://pecl.php.net/package/yaml

If you have pecl installed on your system (apt-get install pecl), you can just do pecl install yaml.

Usually when the extension is installed it is also directly enabled. You can test if it is enabled by creating a php file with <?php phpinfo(); ?> in it and running or visiting it (then search for yaml).

Veda
  • 2,025
  • 1
  • 18
  • 34
0

It turned out I hadn't installed yaml correctly. This article and the instructions that linux itself gives (<3) helped me solve it:

https://code.google.com/p/php-yaml/wiki/InstallingWithPecl

Lazarus Rising
  • 2,597
  • 7
  • 33
  • 58