HTML表单多文件上传

2012-7-19 foooy PHP

单文件上传:

<form id="batchImportForm" method="post" enctype="multipart/form-data">
       <input type="file" id="file" name="file"/>
       <input type="submit" value="Send">
</form> 

多文件上传:

<form method="post" action="upload.php" enctype="multipart/form-data">
    <input name='uploads[]' type="file" multiple>
    <input type="submit" value="Send">
</form>

php接收示例:

foreach ($_FILES['uploads']['name'] as $filename) {
    echo $filename . '<br>';
}


标签: php 文件上传 html

评论(0) 浏览(6128)

python 模块 卸载

2012-7-19 foooy python

第一中方式:
如果模块安装包里没有setup.py uninstall这个选项的话,可以到site-packages包里删除相应的.egg文件

第二中方式:
从新运行安装程序,增加--record参数然后删除
python ./setup.py install --record install.txt
cat install.txt | xargs rm -rf

标签: linux centos python

评论(0) 浏览(1089)

phpmyadmin出现Fatal error: Maximum execution time of 300

2012-7-19 foooy PHP

Fatal error: Maximum execution time of 300 seconds exceeded in

1、把php.ini 里面的 max_execution_time 改大。

2、找到phpMyAdmin\libraries\config.default.php
找到:$cfg['ExecTimeLimit'] = 300;
改成 $cfg['ExecTimeLimit'] = 3000;

标签: php phpmyadmin

评论(0) 浏览(854)

python import psycopg2报ImportError: libpq.so.5: cannot open shared object file: No such file or directory

2012-7-19 foooy postgresql

import psycopg2 报错
Traceback (most recent call last):
  File "<stdin>", line 1, in ?
  File "/usr/lib/python2.4/site-packages/psycopg2-2.4.1-py2.4-linux-x86_64.egg/psycopg2/__init__.py", line 71, in ?
    from psycopg2._psycopg import BINARY, NUMBER, STRING, DATETIME, ROWID
ImportError: libpq.so.5: cannot open shared object file: No such file or directory

解决办法:
cd /etc/ld.so.conf.d
echo "/usr/local/pgsql/lib" >>pgsql.conf
ldconfig

标签: 服务器 linux python OpenERP postgresql

评论(0) 浏览(2531)

php判断系统是win还是linux

2012-7-19 foooy PHP

$os = (DIRECTORY_SEPARATOR=='\\') ? "windows" : 'linux';

评论(0) 浏览(31808)

CentOS更换网易、阿里源

2012-7-19 foooy linux

1、下载新源及将本地源备份
cd /etc/yum.repos.d/
(网易源)
wget http://mirrors.163.com/.help/CentOS6-Base-163.repo
mv CentOS-Base.repo CentOS-Base.repo.bak
mv CentOS6-Base-163.repo CentOS-Base.repo
(阿里源)
wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-6.repo

 

2、yum源更新
 yum clean all && yum makecache

 

标签: linux centos yum

评论(1) 浏览(926)

安装php报错configure: error: wrong mysql library version or lib not found

2012-7-19 foooy PHP

yum -y install mysql-devel

标签: linux centos php mysql

评论(0) 浏览(546)

让nginx支持shtml

2012-7-19 foooy Nginx

nginx支持shtml的方法为:
在nginx.conf配置文件的http标签内下面,添加:
ssi on;
ssi_silent_errors on;
ssi_types text/shtml;
然后保存,重启nginx即可。

标签: linux centos nginx

评论(0) 浏览(573)

Snort中文手册

2012-7-19 foooy linux

Snort+中文手册.rar

标签: linux centos

评论(0) 浏览(438)

安装php的rabbitmq扩展amqp

2012-7-19 foooy

1、在https://github.com/alanxz/rabbitmq-c下载rabbitmq-c

https://github.com/alanxz/rabbitmq-c/releases/download/v0.5.0/rabbitmq-c-0.5.0.tar.gz
tar zxvf rabbitmq-c-0.5.0.tar.gz
cd rabbitmq-c-0.5.0
下载https://github.com/rabbitmq/rabbitmq-codegen
wget https://github.com/rabbitmq/rabbitmq-codegen/archive/rabbitmq_v3_3_3.tar.gz    #就下载到上面rabbitmq-c-0.5.0目录里面
tar zxvf rabbitmq_v3_3_3.tar.gz
mv rabbitmq-codegen-rabbitmq_v3_3_3 codegen

# 配置、编译、安装
autoreconf -i
./configure
make
make install


3、安装安装php的amqp扩展:

wget https://pecl.php.net/get/amqp-1.4.0.tgz
tar -zxvf amqp-1.4.0.tgz
cd amqp-1.4.0
/usr/local/php/bin/phpize
./configure --with-php-config=/usr/local/php/bin/php-config --with-amqp
make
make install
vim /usr/local/php/etc/php.ini
添加 extension = "amqp.so"
重启php即可


标签: linux centos 消息队列 rabbitmq amqp

评论(0) 浏览(585)

Powered by emlog 鄂ICP备14000186号-1 sitemap