简体   繁体   English

PHP-FPM NGinx Pthreads Linux安装

[英]PHP-FPM NGinx Pthreads Linux installation

I'm trying to achieve multiple upload functionality (upload to multiple places at once). 我正在尝试实现多种上传功能(一次上传到多个地方)。 I successfully achieved this on windows (XAMPP + PThreads DLL's) but when installing PHP-FPM+php-pecl-pthreads.x86_64, and extending the Thread class i'm getting the error: 我在Windows(XAMPP + PThreads DLL)上成功实现了这一点,但是在安装PHP-FPM + php-pecl-pthreads.x86_64并扩展Thread类时,出现了错误:

include(Thread.php): failed to open stream: No such file or directory

i tried adding all pthreads.so related to the php.ini: 我尝试添加所有与php.ini相关的pthreads.so:

/usr/lib64/php/modules/pthreads.so
/usr/lib64/php-zts/modules/pthreads.so
/usr/lib64/libpthread.so
/usr/lib/gcc/x86_64-redhat-linux/4.4.4/32/libmudflapth.so
/lib64/libpthread-2.12.so

but i'm getting 但我越来越

undefined symbol: core_globals_id in Unknown on line 0

on my phpinfo i see thread safety is disabled. 在我的phpinfo上,我看到线程安全已禁用。

Did anyone achieve this functionality and can shed some light on how to upload to multiple places at once / installing pthreads successfully on linux. 是否有人实现了此功能,并且可以阐明如何一次上传到多个位置/如何在Linux上成功安装pthreads。

thanks, Danny 谢谢,丹尼

For debian/ubuntu 对于debian / ubuntu

  1. download php source (make sure you have deb-src) 下载php源代码(确保您拥有deb-src)

apt-get source php5

  1. go to that dir 去那个目录

cd php5*

  1. go to ext dir 转到ext dir

cd ext

  1. download pthreads 下载pthreads

git clone https://github.com/krakjoe/pthreads.git

  1. rebuild the configure settings 重建配置设置

cd .. && ./buildconf --force

  1. ensure you have pthreads in configure options 确保您在配置选项中有pthreads

./configure --help | grep pthre

  1. run configure (change the paths as appropriate for your setup) 运行configure(根据您的设置更改路径)

./configure --enable-debug --enable-maintainer-zts --enable-pthreads --prefix=/usr --with-config-file-path=/etc --with-apxs2=/usr/bin/apxs2 --enable-fpm

  1. visit this for more info about user/group specific options if you need them. 如果需要,请访问此页面以获取有关特定于用户/组的选项的更多信息。

make -j2

make -j2 install

  1. Now you will have php compiled with pthreads support. 现在,您将使用pthreads支持编译php。 Verify this: 验证一下:

php -m | grep pthreads

  1. Make init script 制作初始化脚本

copy sapi/fpm/init.d.php-fpm /etc/init.d/php-fpm

  1. change user and group to the username which nginx use in /etc/init.d/php-fpm . usergroup更改为nginx在/etc/init.d/php-fpm使用的用户名。

service nginx restart

  1. Go to your nginx public foolder 前往您的Nginx公共骗子

cd <your-nginx-public-folder>

  1. touch phpinfo.php && echo "<?php phpinfo();" >> phpinfo.php

  2. go to your browser and search for pthreads in http://<your url>/phpinfo.php just created php file 转到浏览器并在刚刚创建的php文件中的http://<your url>/phpinfo.php搜索pthreads

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM