如果您想了解phpapclockingtype是什么解决思路和phplock_ex的知识,那么本篇文章将是您的不二之选。我们将深入剖析phpapclockingtype是什么解决思路的各个方面,并为您
如果您想了解php apc locking type是什么解决思路和php lock_ex的知识,那么本篇文章将是您的不二之选。我们将深入剖析php apc locking type是什么解决思路的各个方面,并为您解答php lock_ex的疑在这篇文章中,我们将为您介绍php apc locking type是什么解决思路的相关知识,同时也会详细的解释php lock_ex的运用方法,并给出实际的案例分析,希望能帮助到您!
本文目录一览:- php apc locking type是什么解决思路(php lock_ex)
- centos下nginx+postgresql+php+memcached+apc
- Drupal 8.2 - PHP 致命错误:APCuIterator::__construct():必须启用 APC 才能使用 APCuIterator
- freebsd php -apc 编译问题
- Installing PHP APC on GNU/Linux Centos 5
php apc locking type是什么解决思路(php lock_ex)
php apc locking type是什么
在php.ini 中修改了apc.rfc1867 = 1,
可是打开phpinfo(),始终显示apc.rfc1867=OFF
往上看有个locking type = File Locks;
会不会和这个有关?
------解决方案--------------------
修改php.ini后还要重启服务器,如apache,php-fpm这些
apc.rfc1867 是关于上传文件进度条的
locking type = File Locks 是缓存编译为字节码文件时的锁类型
------解决方案--------------------
确认修改的php.ini文件是生效的文件.
测试了一下 设置为 1或者On 都可以生效,以下是我的配置内容 你参考一下看看
extension=apc.so
apc.enabled = 1
apc.cache_by_default = on
apc.shm_segments = 1
apc.shm_size = 128m
apc.ttl = 7200
apc.user_ttl = 7200
apc.num_files_hint = 1024
apc.write_lock = On
apc.gc_ttl=3600
apc.ttl=0
apc.mmap_file_mask=/tmp/apc.XXXXXX
apc.rfc1867=1
centos下nginx+postgresql+php+memcached+apc
具体安装步骤如下:
具体安装软件包:
1.升级系统包
yum update
关闭selinux
2.Nginx安装:
安装pcre
yum install pcre*
解压编译:
更改配置文件:
vi /usr/local/Nginx/conf/Nginx.conf
去掉下面一段的注释:
45行添加index.PHP
做好这两个操作后启动Nginx/usr/local/Nginx/sbin/Nginx
3.postgresql安装
安装readline
yum install readline*
解压编译:
postgresql配置:
4.PHP安装
安装所需软件包
解压编译
复制PHP.ini
vim PHP-fpm.conf
这个配置一般默认就可以启动
启动PHP-fpm
/usr/local/PHP/sbin/PHP-fpm
5.memcached安装
安装所需要的软件包:
yum install libevent*
解压编译:
6.memcachedPHP插件安装
安装所需要的软件包
yum install autoconf
解压编译
配置memcached与PHP.ini
/usr/local/PHP/lib/PHP/extensions/no-debug-non-zts-20090626/
vim /usr/local/PHP/lib/PHP.ini
查找extension_dir
更改路径为/usr/local/PHP/lib/PHP/extensions/no-debug-non-zts-20090626/
添加
extension=memcache.so
启动memcached:
/usr/local/memcached/bin/memcached -d m 20-u root -l localhost -p 11211
启动说明:
-d选项是启动一个守护进程,
-m是分配给Memcache使用的内存数量,单位是MB,我这里是10MB,
-u是运行Memcache的用户,我这里是root,
-l是监听的服务器IP地址,如果有多个地址的话,我这里指定了服务器的IP地址192.168.0.200,
-p是设置Memcache监听的端口,我这里设置了12000,最好是1024以上的端口,
-c选项是最大运行的并发连接数,默认是1024,我这里设置了256,按照你服务器的负载量来设定,
-P是设置保存Memcache的pid文件,我这里是保存在/tmp/memcached.pid
7.apc插件的安装
解压编译安装
配置PHP.ini
ls/usr/local/PHP/lib/PHP/extensions/no-debug-non-zts-20090626/
vim /usr/local/PHP/lib/PHP.ini
在extension=memcache.so下面添加extension=apc.so以及
apc.enabled = 1
apc.cache_by_default = on
apc.shm_segments = 1
apc.shm_size = 32
apc.ttl = 600
apc.user_ttl = 600
apc.num_files_hint = 0
apc.write_lock = On
检测是否安装成功
/usr/local/PHP/bin/PHP -m |grep apc
装完后reboot
用PHPinfo查看是否都已经加载
8.开机自动启动
9.防火墙设置
vim /etc/sysconfig/iptables
开启11211和80端口
10.测试脚本
PHPinfo
Memcached
Apc
安装目录下面直接cp apc.PHP /usr/local/Nginx/html
Drupal 8.2 - PHP 致命错误:APCuIterator::__construct():必须启用 APC 才能使用 APCuIterator
如何解决Drupal 8.2 - PHP 致命错误:APCuIterator::__construct():必须启用 APC 才能使用 APCuIterator
当我做 drush cr 时,我得到了这个。登录网站前工作但登录后 - 网站遇到意外错误。请稍后再试。
PHP 致命错误:APCuIterator::__construct():必须启用 APC 才能在第 268 行的 /app/core/lib/Drupal/Core/Cache/ApcuBackend.PHP 中使用 APCuIterator
致命错误:APCuIterator::__construct(): APC 必须在第 268 行的 /app/core/lib/Drupal/Core/Cache/ApcuBackend.PHP 中启用才能使用 APCuIterator 由于不可恢复的错误,Drush 命令异常终止。 [错误] 错误:APCuIterator::__construct():必须启用 APC 才能使用 /app/core/lib/Drupal/Core/Cache/ApcuBackend.PHP 中的 APCuIterator,第 268 行
freebsd php -apc 编译问题
编译一切顺利。php -m 也发现载入。
但是运行php 时:
Fatal error: Unknown: apc_fcntl_unlock failed: in Unknown on line 0
Installing PHP APC on GNU/Linux Centos 5
原贴:http://2bits.com/articles/installing-PHP-apc-gnulinux-centos-5.html
Complex PHP applications, such as Drupal, can gain a lot of performance benefits from running a PHP op-code cache/accelerators.
APC,
Alternate PHP Cache, is Now the most maintained free/open sourceop-code cache, and is being used more and more as it emerges to be the
most stable.
The instructions here detail how to get APC running on a CentOS 5server. The server happened to have Plesk on it as well, whichinitially made me hesitant to install APC "normally", since Plesk is sopicky on what other software is installed on the server. However, itseems to have worked out well.
First, we need the pecl command so we can download and install APC from the repositories.
Do to so, we execute the following command:
yum install PHP-pear
But, this will not run on its own, we need the following package for the PHPize command:
yum install PHP-devel
We also need the apxs command, which is installed via the following package:
yum install httpd-devel
Now we have all the software we need, so we install apc via the pecl command:
pecl install apc
Once that finishes, we need to enable apc in Apache''s configuration. the following command should do this for us.
echo "extension=apc.so" > /etc/PHP.d/apc.ini
Then we restart Apache:
/etc/init.d/httpd start
And we are all done. Watch for less execution time per page,and decreased memory usage per Apache process compared to what you had
before.
Links
You can find some additional tips at Setting up Alternative PHP Caching APC support on Centos server.
- Add new comment
Pecl may not be able to perform the installation
Submitted by Joe (not verified) on Fri, 2008/11/21 - 00:05.
Dueto pecl following an 8 MB restriction that disregards PHP.ini, pecl maybomb out with a Fatal error if you attempt to install apc with it. Youcan solve this by using the command ''pear install pecl/acp'' instead.
»- reply
Got this working on Ubuntu 7.04 Feisty
Submitted by Volomike (not verified) on Sat, 2008/06/14 - 03:53.
I already had PEAR/PECL installed on a system with Apache2 and PHP5, running under Ubuntu 7.04 Feisty.
$ sudo su
# apt-get update
# apt-get install PHP5-dev
# apt-get install apache2-prefork-dev
# apt-get install apache-dev
# pecl install apc
answer yes when prompted
# echo "extension=apc.so" >> /etc/PHP5/apache2/PHP.ini
# /etc/init.d/apache2 stop
# apt-get remove apache2
# apt-get install apache2
# /etc/init.d/apache2 stop
# /etc/init.d/apache2 start
# exit
$
At least I hope this is working. I wish I knew how to test if the performance actually increased.
»- reply
Trouble
Submitted by Sebastian Wikholm (not verified) on Thu, 2008/06/05 - 07:42.
Theinstalling with your instructions goes just fine, but APC doesnt wantto start for me. Apache / PHP gives the following error:
PHP Warning: PHP Startup: Unable to load dynamic library''/usr/lib/PHP/modules/apc.so'' - /usr/lib/PHP/modules/apc.so: cannotopen shared object file: Permission denied in UnkNown on line 0
Any help would really be appreciated
»- reply
Thanks, Khalid.I asked my
Submitted by venkat-rk (not verified) on Tue, 2008/03/25 - 09:57.
Thanks, Khalid.
I asked my host to do it for me and immediately from then onwards, all my drupal pages are showing an internal 500 server error.
Does APC have a problem with PHP running as suPHP (like suexec)?
Thanks,
Venkat
- reply
Doesn''t work
Submitted by Khalid on Tue, 2008/03/25 - 10:44.
ActuallyI recall reading specifically that suexec is kNown not to work withAPC. Perhaps this is because it is CGI (new process every time arequest comes in). The only versions that work with APC and otheraccelerators are the mod_PHP (Apache) or Fast CGI.
In your case, suexec is a Trade off (security vs. performance).
--
2bits -- Drupal consulting
- reply
well, it seems to work:-)My
Submitted by venkat-rk (not verified) on Tue, 2008/03/25 - 10:55.
well, it seems to work:-)
My host had simply given incorrect permissions on the temporary APCscript. I don''t kNow the intricacies of it, but they said setup wouldbe slightly different on a cPanel VPS and enabled it.
Venkat
»- reply
suphp
Submitted by Khalid on Tue, 2008/03/25 - 11:20.
Thanks for the email.
Your site is running suPHP (which is still CGI), and suhosin which some say is incompatible with op-code caches (not sure).
Please try with and without APC using devel and see if the pages execute faster with APC on suPHP. I doubt they would.
--
2bits -- Drupal consulting
- reply
suggestion
Submitted by Drupal Theme Garden (not verified) on Tue, 2008/03/25 - 05:24.
Nice and simple tutorial.
One question:
Why APC, and not eAccelerator?
In some of your prevIoUs articles (benchmarking APC vs eAccelerator using drupal and PHP op code caches/accelerators: a must for a large site) you wrote that eAccelerator has better performance over APC.
- reply
Stability
Submitted by Khalid on Tue, 2008/03/25 - 10:50.
eAccelerator is definitely better than APC for speed (faster) and memory utilization (uses less memory).
However, with newer versions of PHP and Drupal, APC Now has the edgein stability. PrevIoUsly, we had maybe one or two seg faults witheAccelerator per week, which was acceptable, and the logwatcher scriptrestarted things automatically.
After upgrading, it was seg faulting every 2 hours. Once we switched to APC, it was stable and rock solid.
There is also xcache, which we experimented with, but not used in production work.
I plan to publish updated benchmarks of APC, eAccelerator and xcache in the near future.
--
2bits -- Drupal consulting
再分享一下我老师大神的人工智能教程吧。零基础!通俗易懂!风趣幽默!还带黄段子!希望你也加入到我们人工智能的队伍中来!https://blog.csdn.net/jiangjunshow
关于php apc locking type是什么解决思路和php lock_ex的问题就给大家分享到这里,感谢你花时间阅读本站内容,更多关于centos下nginx+postgresql+php+memcached+apc、Drupal 8.2 - PHP 致命错误:APCuIterator::__construct():必须启用 APC 才能使用 APCuIterator、freebsd php -apc 编译问题、Installing PHP APC on GNU/Linux Centos 5等相关知识的信息别忘了在本站进行查找喔。
本文标签: