您的位置:首页 > 运维架构 > Apache

CENTOS Apache 2 + PHP 5.3 + Mysql5 installation (additional: for gallery3 prepare)

2011-03-04 17:51 429 查看
l

I
nstall apache, php,
mysql


>yum -y install httpd
php mysql mysql-server php-mysql

l

U
pgrade to php5.3
(a
bove command
just
install
s
php5.1
)

>rpm -ivh http://repo.webtatic.com/yum/centos/5/`uname -i`/webtatic-release-5-1.noarch.rpm

该命令会在
/etc/yum.repos.d/
folder
下生成一个
”webtatic.repo”
file
,作为其中一个
yum repo (
你可以通过命令

>yum repolist all

来查看你的

yum repo list

)

>yum --disablerepo=*
--enablerepo=webtatic update php

该命令是
disable
所有
repo
,然后只
enable
webtatic repo

and then
use yum to update php to version 5.3

l

install gd (version 2)

>yum --disablerepo=*
--enablerepo=webtatic install php-gd

Additional
Steps for gallery3



l

install php


mbstring


module


>yum --disablerepo=*
--enablerepo=webtatic install php-mbstring

l

install ffmpeg


1. C
reate a repo file for
DAG RPM repository

>vi
/etc/yum.repos.d/dag.repo

2. A
dd following codes to
dag.repo file

[dag]

name=DAG RPM Repository

baseurl=http://apt.sw.be/redhat/el$releasever/en/$basearch/dag

gpgcheck=1

enabled=1

3.
check if ffmpeg exists

>yum search ffmpeg

4. install ffmpeg

>yum install ffmpeg

if following error occurs:

Public key for
ffmpeg-libpostproc-0.6.1-1.el5.rf.i386.rpm is not installed

then run

>rpm --import http://apt.sw.be/RPM-GPG-KEY.dag.txt
run following again

>yum install ffmpeg
ffmpeg-devel ffmpeg-libpostproc

l

install ffmpeg-php


1. Download the

latestet ffmpeg-php from http://sourceforge.net/projects/ffmpeg-php/files/ffmpeg-php/

>wget http://sourceforge.net/projects/ffmpeg-php/files/ffmpeg-php/0.6.0/ffmpeg-php-0.6.0.tbz2/download
2. Extract the archive

> tar -xjf
ffmpeg-php-X.x.x.tbz2

3.
>
cd ffmpeg-php-X.x.x/

4. >phpize

5. >./configure

6. >make

这时会出错:

....error
'PIX_FMT_RGBA32' undeclared...

解决方法:

Goto the the ffmpeg-php-0.x.0 directory and
edit the ffmpeg_frame.c file

>vi ffmpeg_frame.c

replace every instance
of

PIX_FMT_RGBA32

with

PIX_FMT_RGB32

in the file by executing

:%s/PIX_FMT_RGBA32/PIX_FMT_RGB32

OR

replace “PIX_FMT_RGBA32


“PIX_FMT_RGB32

— ffmpeg_frame.c

Save the file and compile ‘ffmpeg-php’
again using the following steps

>make clean

>./configure

>make

7. >make install

Above installation will
copy
the ffmpeg.so module in php default module location.

8.
edit php.ini file to
enable ffmpeg-php support in it by using ffmpeg.so module.

>vi /etc/php.ini

and append following line

extension=ffmpeg.so

9.
Restart apache service
to take effect of php.ini

>/etc/init.d/httpd
restart

10.
Run following command
to ffmpeg module listing in php.

>
php -m | grep ffmpeg

You should be able to see ffmpeg module in
phpinfo() page.

Test it out using

ffmpeg -i videofilename.extension

For more about ffmpeg-php functions –
documentation
http://ffmpeg-php.sourceforge.net/doc/api/ffmpeg_movie.php
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: