ozzieonline

Well-Known Member
Dec 20, 2012
126
0
16
cPanel Access Level
Root Administrator
Hello,

I want to be able to use the yaml_parse function in PHP.

Can anyone please help me to install the extension?

I tries this in Putty:

pecl install yaml

Then I got a message saying I need to install libyaml first. However I can't find the correct way to do that. I found this link InstallingWithPecl - php-yaml - Instructions for installing extension with pecl - LibYAML extension for php - Google Project Hosting and it says you install it by using "apt-get install libyaml-dev", but this is for a Ubuntu machine. Mine is Centos.

Can anyone please help me?
 

ozzieonline

Well-Known Member
Dec 20, 2012
126
0
16
cPanel Access Level
Root Administrator
Thanks for the tip! I just tried it by installing 'yaml' but it says:

"configure: error: Please install libyaml"
I think I have to install libyaml first, but I don't know how.

These are the last lines of the installation attempt (I highlighted the comment about libyaml):

checking whether to enable LibYAML suppot... yes, shared
checking for yaml headers... not found
configure: error: Please install libyaml
ERROR: `/root/tmp/pear/yaml/configure --with-yaml' failed
The yaml.so object is not in /usr/local/lib/php/extensions/no-debug-non-zts-20100525
Tidying /usr/local/lib/php.ini...
No changes
Tidying /usr/local/cpanel/3rdparty/etc/php.ini...
No changes
 

ozzieonline

Well-Known Member
Dec 20, 2012
126
0
16
cPanel Access Level
Root Administrator
Well, I found some instructions how to install libyaml, but I still need a little help. The instructions say I have to download a source package, but it does not mention where I should place it (in which directory) on the server. I created a directory in my main cPanel account directory, but when I executed the commands I got an error saying the path was incorrect and that it could not find a C compiler. Does anybody know where I should place the downloaded file?

Here are the short install instructions: LibYAML

Really hope someone out there can help me.

OOPS... I realise now that I have disabled compiler access in the security settings. Could that be the reason why it's not working? Can I enable it temporarily to install libyaml and then disable it again? Or will it always have to be enabled for libyaml to work?
 
Last edited:

ozzieonline

Well-Known Member
Dec 20, 2012
126
0
16
cPanel Access Level
Root Administrator
You mean as root user? Yes I understand... but where do I place the source package. In which directory??? And does the compiler acces in WHM have to be enabled or is that not necessary?
 

quietFinn

Well-Known Member
Feb 4, 2006
1,067
31
178
Finland
cPanel Access Level
Root Administrator
as the root user do this:
Code:
cd /root
mkdir LibYAML
cd LibYAML
wget http://pyyaml.org/download/libyaml/yaml-0.1.4.tar.gz
tar -xvzf yaml-0.1.4.tar.gz
cd yaml-0.1.4
./configure
make
make install
when you are done you can remove the directory /root/LibYAML

the root user has always compiler access