configure: error: Bitte installieren Sie libyaml

2763
fedorqui

Ich verfolge die Installation der Grundlagen von YAML Parsing in PHP, um YAML für PHP in Fedora 20 zu installieren.

Ich habe all diese Schritte durchgemacht:

wget http://pecl.php.net/get/yaml-1.1.0.tgz tar -xvzf yaml-1.1.0.tgz cd yaml-1.1.0 phpize ./configure && make && make install 

Aber das letzte funktioniert nicht:

# ./configure && make && make install checking for grep that handles long lines and -e... /bin/grep checking for egrep... /bin/grep -E .../... checking for re2c... no configure: WARNING: You will need re2c 0.13.4 or later if you want to regenerate PHP parsers. checking for gawk... gawk checking whether to enable LibYAML suppot... yes, shared checking for yaml headers... not found configure: error: Please install libyaml 

Als ich das "Bitte installiere libyaml" bekomme, habe ich überprüft, ob es installiert ist ... und es ist!

# yum list installed | grep yaml libyaml.x86_64 0.1.6-1.fc20 @updates  yaml-cpp03.x86_64 0.3.0-4.fc20 @anaconda 

Und wenn ich eine PHP-Datei mit einem Aufruf an erzeuge yaml_parse_file(), bekomme ich natürlich den Fehler:

Fatal error: Call to undefined function yaml_parse_file() in XXXfile on line YYY 

Was darf fehlen?

0

2 Antworten auf die Frage

1
ShineChun

Sie sollten libyaml-dev nicht libyaml installieren. Ich installiere es auf Centos:

[vagrant@localhost yaml-1.2.0]$ sudo yum search libyaml ============================================ N/S Matched: libyaml ============================================ libyaml-devel.i686 : Development files for LibYAML applications libyaml-devel.x86_64 : Development files for LibYAML applications libyaml.i686 : YAML 1.1 parser and emitter written in C libyaml.x86_64 : YAML 1.1 parser and emitter written in C [vagrant@localhost yaml-1.2.0]$ sudo yum install -y libyaml-devel.x86_64 

als ich erfolgreich mache。

0
fedorqui

Oh, das sollte nicht so enden, aber ich habe durch Howto Install with Pecl- Dokumentation in Code Google eine Lösung gefunden :

  • Installieren Sie LibYAML mit Ihrer bevorzugten Methode. Zum Beispiel auf einem Ubuntu-Rechner sudo apt-get install libyaml-devbekommt, was Sie brauchen.
  • sudo pecl install yaml-beta
  • Bearbeiten Sie Ihre php.ini-Einstellungen und fügen Sie sie hinzu extension=yaml.so
  • Sehen Sie, ob es funktioniert hat php --re yaml

Da ich auf Fedora bin, musste ich etwas anders vorgehen:

# yum search yaml | grep -i php php-symfony-YAML.noarch : The Symfony YAML Component php-pecl-yaml.x86_64 : PHP Bindings for yaml php-symfony-yaml.noarch : Symfony Yaml Component php-symfony2-Yaml.noarch : Symfony2 Yaml Component php54-php-pecl-yaml.x86_64 : PHP Bindings for yaml php56-php-pecl-yaml.x86_64 : PHP Bindings for yaml syck.i686 : YAML for C, Python, and PHP syck.x86_64 : YAML for C, Python, and PHP syck-php.x86_64 : YAML module for php 

Also habe ich installiert php-pecl-yaml.x86_64:

# yum install php-pecl-yaml.x86_64 

Ich habe die Zeile in meine php.iniDatei eingefügt, Apache neu gestartet, und jetzt bekomme ich eine gute Ausgabe von:

# php --re yaml Extension [ <persistent> extension #16 yaml version 1.1.1 ] {  - Dependencies { Dependency [ date (Optional) ] }  - INI { Entry [ yaml.decode_binary <ALL> ] Current = '0' } Entry [ yaml.decode_timestamp <ALL> ] Current = '0' } Entry [ yaml.output_canonical <ALL> ] Current = '0'  .../...  Function [ <internal:yaml> function yaml_emit_file ] {  - Parameters [5] { Parameter #0 [ <required> $filename ] Parameter #1 [ <required> $data ] Parameter #2 [ <optional> $encoding ] Parameter #3 [ <optional> $linebreak ] Parameter #4 [ <optional> array $callbacks ] } } } }