服务器维护,服务器代维,安全设置,漏洞扫描,入侵检测服务

运维之家

 找回密码
 注册
搜索
查看: 16653|回复: 5

安装ClipBucket环境

[复制链接]
dirtysea 发表于 2012-3-14 15:17:30 | 显示全部楼层 |阅读模式
官网 http://clip-bucket.com/  开源下载:http://sourceforge.net/projects/clipbucket/

安装一款国外的开源视频分享网站,类似于国内的土豆,优酷等,每个人都可以上传分享视频的开源软件
有中文版的哦,下面就来说说怎么样安装ClipBucket环境


预览图

2012-2-10 14:33:49 上传
下载附件 (270.8 KB)

一,安装依赖环境:
  • yum -y install gcc gcc-c++ autoconf libjpeg libjpeg-devel libpng libpng-devel freetype freetype-devel libxml2 libxml2-devel zlib zlib-devel glibc glibc-devel glib2 glib2-devel bzip2 bzip2-devel ncurses ncurses-devel curl curl-devel e2fsprogs e2fsprogs-devel krb5 krb5-devel libidn libidn-devel openssl openssl-devel openldap openldap-devel nss_ldap openldap-clients openldap-servers vixie-cron crontabs net-snmp tcpdump unzip autoconf kernel-devel wget ntp

复制代码

建立用户和目录
useradd -s /sbin/nologin mysql
useradd -s /sbin/nologin www

mkdir -p /usr/local/lnmp
mkdir -p /data/wwwroot
mkdir -p /data/mysql
mkdir -p /data/wwwroot/logs
mkdir -p /data/wwwroot/www
chmod +w /data/wwwroot/logs
chown -R www:www /data/wwwroot



二,安装PHP:

复制代码

tar zxvf libiconv-1.13.1.tar.gz
cd libiconv-1.13.1/
./configure --prefix=/usr/local
make
make install
cd ../

tar zxvf libmcrypt-2.5.8.tar.gz
cd libmcrypt-2.5.8/
./configure
make
make install
/sbin/ldconfig
cd libltdl/
./configure --enable-ltdl-install
make
make install
cd ../../

tar zxvf mhash-0.9.9.9.tar.gz
cd mhash-0.9.9.9/
./configure
make
make install
cd ../


ln -s /usr/local/lib/libmcrypt.la /usr/lib/libmcrypt.la
ln -s /usr/local/lib/libmcrypt.so /usr/lib/libmcrypt.so
ln -s /usr/local/lib/libmcrypt.so.4 /usr/lib/libmcrypt.so.4
ln -s /usr/local/lib/libmcrypt.so.4.4.8 /usr/lib/libmcrypt.so.4.4.8
ln -s /usr/local/lib/libmhash.a /usr/lib/libmhash.a
ln -s /usr/local/lib/libmhash.la /usr/lib/libmhash.la
ln -s /usr/local/lib/libmhash.so /usr/lib/libmhash.so
ln -s /usr/local/lib/libmhash.so.2 /usr/lib/libmhash.so.2
ln -s /usr/local/lib/libmhash.so.2.0.1 /usr/lib/libmhash.so.2.0.1
ln -s /usr/local/bin/libmcrypt-config /usr/bin/libmcrypt-config

tar zxvf mcrypt-2.6.8.tar.gz
cd mcrypt-2.6.8/
/sbin/ldconfig
./configure
make
make install
cd ../


2,安装数据库
tar -zxvf mysql-5.1.58.tar.gz
cd mysql-5.1.58/
./configure --prefix=/usr/local/lnmp/mysql/ --enable-assembler --with-extra-charsets=complex --enable-thread-safe-client --with-big-tables --with-readline --with-ssl --with-embedded-server --enable-local-infile --with-plugins=innobase
make && make install
cd ../


配置数据库
vi /etc/my.cnf
输入:
  • [client]
  • default-character-set = utf8
  • port = 3306
  • socket = /tmp/mysql.sock
  • [mysql]
  • no-auto-rehash
  • [mysqld]
  • default-character-set = utf8
  • user = mysql
  • port = 3306
  • socket = /tmp/mysql.sock
  • basedir = /usr/local/lnmp/mysql
  • datadir = /data/mysql/data
  • open_files_limit = 10240
  • back_log = 600
  • max_connections = 3000
  • max_connect_errors = 6000
  • table_cache = 614
  • external-locking = FALSE
  • max_allowed_packet = 32M
  • sort_buffer_size = 2M
  • join_buffer_size = 2M
  • thread_cache_size = 300
  • thread_concurrency = 8
  • query_cache_size = 32M
  • query_cache_limit = 2M
  • query_cache_min_res_unit = 2k
  • default-storage-engine = MyISAM
  • default_table_type = MyISAM
  • thread_stack = 192K
  • transaction_isolation = READ-COMMITTED
  • tmp_table_size = 246M
  • max_heap_table_size = 246M
  • long_query_time = 1
  • log_long_format
  • log-bin = /data/mysql/binlog
  • binlog_cache_size = 4M
  • binlog_format = MIXED
  • max_binlog_cache_size = 8M
  • max_binlog_size = 512M
  • expire_logs_days = 7
  • key_buffer_size = 256M
  • read_buffer_size = 1M
  • read_rnd_buffer_size = 16M
  • bulk_insert_buffer_size = 64M
  • myisam_sort_buffer_size = 128M
  • myisam_max_sort_file_size = 10G
  • myisam_max_extra_sort_file_size = 10G
  • myisam_repair_threads = 1
  • myisam_recover
  • skip-name-resolve
  • master-connect-retry = 10
  • slave-skip-errors = 1032,1062,126,1114,1146,1048,1396
  • server-id = 1
  • innodb_additional_mem_pool_size = 16M
  • innodb_buffer_pool_size = 64M
  • innodb_data_file_path = ibdata1:1024M:autoextend
  • innodb_file_io_threads = 4
  • innodb_thread_concurrency = 8
  • innodb_flush_log_at_trx_commit = 2
  • innodb_log_buffer_size = 16M
  • innodb_log_file_size = 128M
  • innodb_log_files_in_group = 3
  • innodb_max_dirty_pages_pct = 90
  • innodb_lock_wait_timeout = 120
  • innodb_file_per_table = 0
  • [mysqldump]
  • quick
  • max_allowed_packet = 32M

复制代码


chmod +w /usr/local/lnmp/mysql/
chown -R mysql:mysql /usr/local/lnmp/mysql/
chown -R mysql:mysql /data/mysql

/usr/local/lnmp/mysql/bin/mysql_install_db --basedir=/usr/local/lnmp/mysql/ --datadir=/data/mysql/data --user=mysql

添加数据库为系统服务:
cp /usr/local/lnmp/mysql/share/mysql/mysql.server /etc/init.d/mysql
  • cat >> /etc/ld.so.conf.d/mysql.conf<<EOF
  • /usr/local/lnmp/mysql/lib/mysql
  • /usr/local/lib
  • EOF
  • ldconfig

复制代码
ln -s /usr/local/lnmp/mysql/lib/mysql /usr/lib/mysql
ln -s /usr/local/lnmp/mysql/include/mysql /usr/include/mysql
ln -s /usr/local/lnmp/mysql/bin/mysql /usr/bin/mysql
ln -s /usr/local/lnmp/mysql/bin/mysqldump /usr/bin/mysqldump
ln -s /usr/local/lnmp/mysql/bin/myisamchk /usr/bin/myisamchk

chmod 755 /etc/init.d/mysql
chkconfig --add mysql
chkconfig --level 35 mysql on

启动数据库:
service mysql start

配置数据库root密码:
/usr/local/lnmp/mysql/bin/mysqladmin -u root -h 127.0.0.1 password


数据库安装完毕

3,安装PHP
ln -s /usr/local/lnmp/mysql/bin/mysql_config /usr/bin/mysql_config

tar zxvf php-5.2.17.tar.gz
gzip -cd php-5.2.17-fpm-0.5.14.diff.gz | patch -d php-5.2.17 -p1
cd php-5.2.17/
./configure --prefix=/usr/local/lnmp/php --with-config-file-path=/usr/local/lnmp/php/etc --with-mysql=/usr/local/lnmp/mysql --with-mysqli=/usr/local/lnmp/mysql/bin/mysql_config --with-iconv-dir=/usr/local --with-freetype-dir --with-jpeg-dir --with-png-dir --with-zlib --with-libxml-dir=/usr --enable-xml --disable-rpath --enable-discard-path --enable-safe-mode --enable-bcmath --enable-shmop --enable-sysvsem --enable-inline-optimization --with-curl --with-curlwrappers --enable-mbregex --enable-fastcgi --enable-fpm --enable-force-cgi-redirect --enable-mbstring --with-mcrypt --with-gd --enable-gd-native-ttf --with-openssl --with-mhash --enable-pcntl --enable-sockets --with-ldap --with-ldap-sasl --with-xmlrpc --enable-zip --enable-soap

make ZEND_EXTRA_LIBS='-liconv'
make install

cp php.ini-dist /usr/local/lnmp/php/etc/php.ini

安装PHP扩展组件
cd $src_dir
tar zxvf memcache-2.2.6.tgz
cd memcache-2.2.6/
/usr/local/lnmp/php/bin/phpize
./configure --with-php-config=/usr/local/lnmp/php/bin/php-config
make
make install
cd ../

tar jxvf eaccelerator-0.9.6.1.tar.bz2
cd eaccelerator-0.9.6.1/
/usr/local/lnmp/php/bin/phpize
./configure --enable-eaccelerator=shared --with-php-config=/usr/local/lnmp/php/bin/php-config
make
make install
cd ../

tar zxvf ImageMagick.tar.gz
cd ImageMagick-6.7.2-3/
./configure
make
make install
cd ../

tar zxvf imagick-2.3.0.tgz
cd imagick-2.3.0/
/usr/local/lnmp/php/bin/phpize
./configure --with-php-config=/usr/local/lnmp/php/bin/php-config
make
make install
cd ../


tar zxvf PDO_MYSQL-1.0.2.tgz
cd PDO_MYSQL-1.0.2/
/ulllsr/local/lnmp/php/bin/phpize
./configure --with-php-config=/usr/local/lnmp/php/bin/php-config --with-pdo-mysql=/usr/local/lnmp/mysql
make
make install
cd ../

配置PHP加载扩展
sed -i 's#extension_dir = "./"#extension_dir = "/usr/local/lnmp/php/lib/php/extensions/no-debug-non-zts-20060613/"\nextension = "memcache.so"\nextension = "pdo_mysql.so"\nextension = "imagick.so"\n#' /usr/local/lnmp/php/etc/php.ini
sed -i 's#output_buffering = Off#output_buffering = On#' /usr/local/lnmp/php/etc/php.ini
sed -i "s#; always_populate_raw_post_data = On#always_populate_raw_post_data = On#g" /usr/local/lnmp/php/etc/php.ini
sed -i "s#; cgi.fix_pathinfo=0#cgi.fix_pathinfo=0#g" /usr/local/lnmp/php/etc/php.ini
sed -i 's/short_open_tag = Off/short_open_tag = On/g' /usr/local/lnmp/php/etc/php.ini
sed -i 's/;date.timezone =/date.timezone = PRC/g' /usr/local/lnmp/php/etc/php.ini
sed -i 's/post_max_size = 8M/post_max_size = 50M/g' /usr/local/lnmp/php/etc/php.ini
sed -i 's/upload_max_filesize = 2M/upload_max_filesize = 50M/g' /usr/local/lnmp/php/etc/php.ini
sed -i 's/max_execution_time = 30/max_execution_time = 300/g' /usr/local/lnmp/php/etc/php.ini


mkdir -p /usr/local/lnmp/eaccelerator_cache
rm -rf /usr/local/lnmp/php/etc/php-fpm.conf
vi /usr/local/lnmp/php/etc/php-fpm.conf
输入:
  • <?xml version="1.0" ?>
  • <configuration>
  •   All relative paths in this config are relative to php's install prefix
  •   <section name="global_options">
  •     Pid file
  •     <value name="pid_file">/usr/local/lnmp/php/logs/php-fpm.pid</value>
  •     Error log file
  •     <value name="error_log">/usr/local/lnmp/php/logs/php-fpm.log</value>
  •     Log level
  •     <value name="log_level">notice</value>
  •     When this amount of php processes exited with SIGSEGV or SIGBUS ...
  •     <value name="emergency_restart_threshold">10</value>
  •     ... in a less than this interval of time, a graceful restart will be initiated.
  •     Useful to work around accidental curruptions in accelerator's shared memory.
  •     <value name="emergency_restart_interval">1m</value>
  •     Time limit on waiting child's reaction on signals from master
  •     <value name="process_control_timeout">5s</value>
  •     Set to 'no' to debug fpm
  •     <value name="daemonize">yes</value>
  •   </section>
  •   <workers>
  •     <section name="pool">
  •       Name of pool. Used in logs and stats.
  •       <value name="name">default</value>
  •       Address to accept fastcgi requests on.
  •       Valid syntax is 'ip.ad.re.ss:port' or just 'port' or '/path/to/unix/socket'
  •       <value name="listen_address">127.0.0.1:9000</value>
  •       <value name="listen_options">
  •         Set listen(2) backlog
  •         <value name="backlog">-1</value>
  •         Set permissions for unix socket, if one used.
  •         In Linux read/write permissions must be set in order to allow connections from web server.
  •         Many BSD-derrived systems allow connections regardless of permissions.
  •         <value name="owner"></value>
  •         <value name="group"></value>
  •         <value name="mode">0666</value>
  •       </value>
  •       Additional php.ini defines, specific to this pool of workers.
  •       <value name="php_defines">
  •         <value name="sendmail_path">/usr/sbin/sendmail -t -i</value>
  •         <value name="display_errors">0</value>
  •       </value>
  •       Unix user of processes
  •       <value name="user">www</value>
  •       Unix group of processes
  •       <value name="group">www</value>
  •       Process manager settings
  •       <value name="pm">
  •         Sets style of controling worker process count.
  •         Valid values are 'static' and 'apache-like'
  •         <value name="style">static</value>
  •         Sets the limit on the number of simultaneous requests that will be served.
  •         Equivalent to Apache MaxClients directive.
  •         Equivalent to PHP_FCGI_CHILDREN environment in original php.fcgi
  •         Used with any pm_style.
  •         <value name="max_children">128</value>
  •         Settings group for 'apache-like' pm style
  •         <value name="apache_like">
  •           Sets the number of server processes created on startup.
  •           Used only when 'apache-like' pm_style is selected
  •           <value name="StartServers">20</value>
  •           Sets the desired minimum number of idle server processes.
  •           Used only when 'apache-like' pm_style is selected
  •           <value name="MinSpareServers">5</value>
  •           Sets the desired maximum number of idle server processes.
  •           Used only when 'apache-like' pm_style is selected
  •           <value name="MaxSpareServers">35</value>
  •         </value>
  •       </value>
  •       The timeout (in seconds) for serving a single request after which the worker process will be terminated
  •       Should be used when 'max_execution_time' ini option does not stop script execution for some reason
  •       '0s' means 'off'
  •       <value name="request_terminate_timeout">0s</value>
  •       The timeout (in seconds) for serving of single request after which a php backtrace will be dumped to slow.log file
  •       '0s' means 'off'
  •       <value name="request_slowlog_timeout">0s</value>
  •       The log file for slow requests
  •       <value name="slowlog">logs/slow.log</value>
  •       Set open file desc rlimit
  •       <value name="rlimit_files">65535</value>
  •       Set max core size rlimit
  •       <value name="rlimit_core">0</value>
  •       Chroot to this directory at the start, absolute path
  •       <value name="chroot"></value>
  •       Chdir to this directory at the start, absolute path
  •       <value name="chdir"></value>
  •       Redirect workers' stdout and stderr into main error log.
  •       If not set, they will be redirected to /dev/null, according to FastCGI specs
  •       <value name="catch_workers_output">yes</value>
  •       How much requests each process should execute before respawn.
  •       Useful to work around memory leaks in 3rd party libraries.
  •       For endless request processing please specify 0
  •       Equivalent to PHP_FCGI_MAX_REQUESTS
  •       <value name="max_requests">1024</value>
  •       Comma separated list of ipv4 addresses of FastCGI clients that allowed to connect.
  •       Equivalent to FCGI_WEB_SERVER_ADDRS environment in original php.fcgi (5.2.2+)
  •       Makes sense only with AF_INET listening socket.
  •       <value name="allowed_clients">127.0.0.1</value>
  •       Pass environment variables like LD_LIBRARY_PATH
  •       All $VARIABLEs are taken from current environment
  •       <value name="environment">
  •         <value name="HOSTNAME">$HOSTNAME</value>
  •         <value name="PATH">/usr/local/bin:/usr/bin:/bin</value>
  •         <value name="TMP">/tmp</value>
  •         <value name="TMPDIR">/tmp</value>
  •         <value name="TEMP">/tmp</value>
  •         <value name="OSTYPE">$OSTYPE</value>
  •         <value name="MACHTYPE">$MACHTYPE</value>
  •         <value name="MALLOC_CHECK_">2</value>
  •       </value>
  •     </section>
  •   </workers>
  • </configuration>

复制代码
配置eaccelerator:
cat >>/usr/local/lnmp/php/etc/php.ini<<EOF
[eaccelerator]
zend_extension="/usr/local/lnmp/php/lib/php/extensions/no-debug-non-zts-20060613/eaccelerator.so"
eaccelerator.shm_size="64"
eaccelerator.cache_dir="/usr/local/lnmp/eaccelerator_cache"
eaccelerator.enable="1"
eaccelerator.optimizer="1"
eaccelerator.check_mtime="1"
eaccelerator.debug="0"
eaccelerator.filter=""
eaccelerator.shm_max="0"
eaccelerator.shm_ttl="3600"
eaccelerator.shm_prune_period="3600"
eaccelerator.shm_only="0"
eaccelerator.compress="1"
eaccelerator.compress_level="9"

[Zend Optimizer]
zend_optimizer.optimization_level=1
zend_extension="/usr/local/lnmp/zend/ZendOptimizer.so"
EOF


启动PHP:/usr/local/lnmp/php/sbin/php-fpm
PHP安装完毕

三,安装nginx

tar zxvf pcre-8.12.tar.gz
cd pcre-8.12/
./configure
make && make install
cd ..

tar zxvf nginx-1.0.6.tar.gz
cd nginx-1.0.6/
./configure --user=www --group=www --prefix=/usr/local/lnmp/nginx --with-http_stub_status_module --with-http_ssl_module --with-http_gzip_static_module --with-ipv6
make && make install
cd ../


配置nginx:
rm -f /usr/local/lnmp/nginx/conf/nginx.conf

cat > /usr/local/lnmp/nginx/conf/fcgi.conf<<EOF
if (\$request_filename ~* (.*)\.php) {
    set \$php_url \$1;
}
if (!-e \$php_url.php) {
        return 403;
}
fastcgi_param  GATEWAY_INTERFACE  CGI/1.1;
fastcgi_param  SERVER_SOFTWARE    nginx;
fastcgi_param  QUERY_STRING       \$query_string;
fastcgi_param  REQUEST_METHOD     \$request_method;
fastcgi_param  CONTENT_TYPE       \$content_type;
fastcgi_param  CONTENT_LENGTH     \$content_length;
fastcgi_param  SCRIPT_FILENAME    \$document_root\$fastcgi_script_name;
fastcgi_param  SCRIPT_NAME        \$fastcgi_script_name;
fastcgi_param  REQUEST_URI        \$request_uri;
fastcgi_param  DOCUMENT_URI       \$document_uri;
fastcgi_param  DOCUMENT_ROOT      \$document_root;
fastcgi_param  SERVER_PROTOCOL    \$server_protocol;
fastcgi_param  REMOTE_ADDR        \$remote_addr;
fastcgi_param  REMOTE_PORT        \$remote_port;
fastcgi_param  SERVER_ADDR        \$server_addr;
fastcgi_param  SERVER_PORT        \$server_port;
fastcgi_param  SERVER_NAME        \$server_name;
#PHP only, required if PHP was built with --enable-force-cgi-redirect
fastcgi_param  REDIRECT_STATUS    200;
EOF


配置:nginx
vi /usr/local/lnmp/nginx/conf/nginx.conf
输入:
  • user  www www;worker_processes 8;error_log  /data/wwwroot/logs/nginx_error.log  crit;pid        /usr/local/lnmp/nginx/logs/nginx.pid;#Specifies the value for maximum file descriptors that can be opened by this process.worker_rlimit_nofile 65535;events{  use epoll;  worker_connections 65535;}
  • http        {                include       mime.types;                default_type  application/octet-stream;
  •                 server_names_hash_bucket_size 128;                client_header_buffer_size 32k;                large_client_header_buffers 4 32k;                client_max_body_size 50m;
  •                 sendfile on;                tcp_nopush     on;
  •                 keepalive_timeout 60;
  •                 tcp_nodelay on;
  •                 fastcgi_connect_timeout 300;                fastcgi_send_timeout 300;                fastcgi_read_timeout 300;                fastcgi_buffer_size 64k;                fastcgi_buffers 4 64k;                fastcgi_busy_buffers_size 128k;                fastcgi_temp_file_write_size 256k;
  •                 gzip on;                gzip_min_length  1k;                gzip_buffers     4 16k;                gzip_http_version 1.0;                gzip_comp_level 2;                gzip_types       text/plain application/x-javascript text/css application/xml;                gzip_vary on;
  •                 #limit_zone  crawler  $binary_remote_addr  10m;
  • server  {    listen       80;    server_name  www.ywlm.net;    index index.html index.htm index.php;    root  /data/wwwroot/www;    #limit_conn   crawler  20;
  •     location ~ .*\.(php|php5)?[        DISCUZ_CODE_952        ]nbsp;   {      #fastcgi_pass  unix:/tmp/php-cgi.sock;      fastcgi_pass  127.0.0.1:9000;      fastcgi_index index.php;      include fcgi.conf;    }
  •     location ~ .*\.(gif|jpg|jpeg|png|bmp|swf)[        DISCUZ_CODE_952        ]nbsp;   {      expires      30d;    }    location ~ .*\.(js|css)?[        DISCUZ_CODE_952        ]nbsp;   {      expires      1h;    }    access_log  off;      }  server  {    listen  80;    server_name  status.ywlm.net;    location / {    stub_status on;    access_log   off;    }  }}

复制代码

启动nginx:/usr/local/lnmp/nginx/sbin/nginx


基本环节全部安装完毕,下面是安装ClipBucket部分


四,安装ClipBucket

到官方网站下载程序:http://clip-bucket.com/
2012-2-10 14:18:23 上传
下载附件 (130.11 KB)




上传:ClipBucket中upload到/data/wwwroot/www目录
在浏览器上输入http://ip/cb_install
即可得到安装界面,根据提示一步一步安装,如图:
第一步:创建数据库cb:

2012-2-10 14:21:22 上传
下载附件 (22.42 KB)




第二不:输入:http://yourip/cb_install

**到安装界面

2012-2-10 14:25:57 上传
下载附件 (62.38 KB)





检查环境

2012-2-10 14:25:58 上传
下载附件 (41.21 KB)




检查目录是否可写,如果有提示为红色的,这吧目录权限设置为777

2012-2-10 14:25:58 上传
下载附件 (59.07 KB)




设置管理员密码,默认是admin

2012-2-10 14:25:59 上传
下载附件 (39.83 KB)




2012-2-10 14:25:59 上传
下载附件 (39.67 KB)




连接数据库设置

2012-2-10 14:25:59 上传
下载附件 (45.94 KB)





安装完成,要求删除安装目录,安装提示做即可

2012-2-10 14:26:00 上传
下载附件 (65.89 KB)







注意,如果提示下面错误,这可安装二楼去做即可

PrecheckingClipbucket requires following modules in order to work properly, we are performing some initial search to find modules. Click here for why we need these modules


  • PHPFound PHP 5.2.17
  • FFMPEGUnable to find ffmpeg
  • FLVtool2Unable to find flvtool2
  • MP4BoxUnable to find MP4Box
  • cURLcURL 7.15.5 found
  • PHPShieldPHPShield loaders are not installed (optional)

复制代码
2012-2-10 10:52:17 上传
下载附件 (40.47 KB)






安装完成后预览图:
2012-2-10 14:36:12 上传
下载附件 (270.8 KB)




是不是很酷?
------------------------------------------------------------------------------------------------------------------------------------------------------------
下面是解决一些依赖问题



 楼主| dirtysea 发表于 2012-3-14 15:49:57 | 显示全部楼层
php扩展模块ffmpeg-php安装


译安装ffmpeg非常的麻烦,还好我们找到了一个yum源可以方便的安装ffmpeg以及ffmpeg-dev,下面是步骤:

(1)
vi /etc/yum.repos.d/dag.repo
输入:

  1. make: *** [ffmpeg_frame.lo] Error 1
复制代码

则:
  • mv ffmpeg_frame.loT ffmpeg_frame.lo

复制代码

如果启动php的时候如果有ffmepg-php模块错误提示:

  • php: symbol lookup error: /usr/local/php/lib/php/extensions/no-debug-non-zts-20060613/ffmpeg.so: undefined symbol: register_ffmpeg_frame_class

复制代码
则执行:
  • nm /usr/local/php/lib/php/extensions/no-debug-non-zts-20060613/ffmpeg.so | grep register_ffmpeg_frame_class

复制代码
若执行结果输出

  • U register_ffmpeg_frame_class

复制代码
则修改ffmpeg_frame.c,将3处的PIX_FMT_RGBA32 更改为PIX_FMT_RGB32即可。
vi ffmpeg_frame.c
  • :%s/PIX_FMT_RGBA32/PIX_FMT_RGB32

复制代码
  • :wq!

复制代码
继续安装
  • ./configure --with-php-config=/usr/local/webserver/php/bin/php-config
  • make test
  • make
  • make install

复制代码


编写测试代码
vi test.php
  • <?php
  • $mov= new ffmpeg_movie('./12.rmvb');
  • $ff_frame = $mov->getFrame(120);
  • $gd_image = $ff_frame->toGDImage();
  • $img=$_SERVER['DOCUMENT_ROOT']."/test.jpg";//要生成图片的绝对路径
  • imagejpeg($gd_image, $img);//创建jpg图像
  • imagedestroy($gd_image);//销毁一图像?>

复制代码

显示效果:
2012-2-10 11:06:41 上传
下载附件 (109.56 KB)


 楼主| dirtysea 发表于 2012-3-14 15:50:46 | 显示全部楼层
安装flvtool2



复制代码
官方地址:
http://rubyforge.org
 楼主| dirtysea 发表于 2012-3-14 15:51:02 | 显示全部楼层
mp4box 安装

安装必要组件:
  1. /usr/bin/ld: skipping incompatible /usr/lib/libGL.so when searching for -lGL/usr/bin/ld: cannot find -lGLcollect2: ld returned 1 exit statusmake[1]: *** [libgpac.so] Error 1make[1]: Leaving directory `/root/gpac/src’make: *** [lib] Error 2
复制代码


原因是mesa-libGL-devel这个包可能不完整,直接使用yum -y install mesa-libGL-devel命令把这个包安装一下,然后在make的时候就正常了。
 楼主| dirtysea 发表于 2012-3-14 15:52:35 | 显示全部楼层
安装完成后发现还是无法进行视频转换,进后台看发现:
2012-2-10 12:43:44 上传
下载附件 (180.05 KB)



后台路径设置一下即可:
php
/usr/local/lnmp/php/bin/php

flvtool2
/usr/bin/flvtool2

ffmpeg
/usr/bin/ffmpeg
 楼主| dirtysea 发表于 2012-3-14 15:53:01 | 显示全部楼层
PHPSHIELD的安装
首先去首页http://www.phpshield.com/loaders/找到对应的
如图:
2012-2-10 12:45:23 上传
下载附件 (123.55 KB)




Linux:选择红框所注:
下载解压后出现下面文件:
2012-2-10 12:47:04 上传
下载附件 (46.34 KB)






选择ixed.5.2.lin,上传到服务器/usr/local/lnmp/php/lib/php/extensions/no-debug-non-zts-20060613/目录下
这个目录根据你的实际情况来定
然后修改php.ini文件
  • extension_dir = "/usr/local/lnmp/php/lib/php/extensions/no-debug-non-zts-20060613/"
  • extension = "memcache.so"
  • extension = "pdo_mysql.so"
  • extension = "imagick.so"
  • extension = "ffmpeg.so"
  • extension = "ixed.5.2.lin"

复制代码
看到extension = "ixed.5.2.lin"了吧,然后重启php即可!


注意,这里ixed.5.2中的5.2和你用的PHP版本要对应着呢
您需要登录后才可以回帖 登录 | 注册

本版积分规则

QQ|小黑屋|手机版|Archiver|运维之家

GMT+8, 2022-8-18 00:41 , Processed in 0.160240 second(s), 18 queries .

Powered by Dirtysea

© 2008-2020 Dirtysea.com.

快速回复 返回顶部 返回列表