Opcache + Memcached Together - php

my environment
ubuntu 14.04 , php 5.5 , nginx 1.76
i am using both opcache and xcache concurrently
PHP 5.5.19-1+deb.sury.org~trusty+1 (cli) (built: Nov 19 2014 19:33:43)
Copyright (c) 1997-2014 The PHP Group
Zend Engine v2.5.0, Copyright (c) 1998-2014 Zend Technologies
can i use both opcache and memchached together .. i dont know whether this allowed or not ?
suggestions invited ? ?

Related

constant cannot be resolved on a server

constants.php
<?
define('GREETING', 'Hello World');
?>
index.php
<?php
require("constants.php");
echo GREETING;
?>
This code gives me an error : PHP Notice: Use of undefined constant GREETING - assumed 'GREETING'
(Server 1 - Not Working) Ubuntu 14.04
PHP 5.5.9-1ubuntu4.14 (cli) (built: Oct 28 2015 01:34:46)
Copyright (c) 1997-2014 The PHP Group
Zend Engine v2.5.0, Copyright (c) 1998-2014 Zend Technologies
with Zend OPcache v7.0.3, Copyright (c) 1999-2014, by Zend Technologies
(Server 2 - Working) CentOS 6.3
PHP 5.4.13 (cli) (built: Mar 14 2013 08:57:49)
Copyright (c) 1997-2013 The PHP Group
Zend Engine v2.4.0, Copyright (c) 1998-2013 Zend Technologies
with the ionCube PHP Loader v4.6.0, Copyright (c) 2002-2014, by ionCube Ltd.
(Dev Environment - Working) Windows 8.1
PHP 5.5.9 (cli) (built: Feb 5 2014 13:02:39)
Copyright (c) 1997-2014 The PHP Group
Zend Engine v2.5.0, Copyright (c) 1998-2014 Zend Technologies
with the ionCube PHP Loader v4.5.3, Copyright (c) 2002-2014, by ionCube Ltd.
What could be the problem and how do I make it work for Server 1?
Previous programmer made used of short tags which turned the block into a comment

How can I update the php5-cli package on this Linux distribution?

I have a godaddy shared hosting account
I don't know what distribution is my account using.
So, I ran the uname -a command and here is the response:-
Linux a2plcpnl0006.prod.iad2.secureserver.net 2.6.32- 531.29.2.lve1.3.11.1.el6.x86_64 #1 SMP Thu Dec 18 06:49:17 EST 2014 x86_64 x86_64 x86_64 GNU/Linux
running the php -v command gives the following output:-
PHP 5.4.43 (cli) (built: Jul 23 2015 20:40:13)
Copyright (c) 1997-2014 The PHP Group
Zend Engine v2.4.0, Copyright (c) 1998-2014 Zend Technologies
with the ionCube PHP Loader v4.7.5, Copyright (c) 2002-2014, by ionCube Ltd., and
with Zend Guard Loader v3.3, Copyright (c) 1998-2013, by Zend Technologies
and running php-cgi -v command gives the following result:-
PHP 5.5.24 (cgi-fcgi) (built: Apr 20 2015 06:24:55)
Copyright (c) 1997-2015 The PHP Group
Zend Engine v2.5.0, Copyright (c) 1998-2015 Zend Technologies
I want to update the php-cli package to version 5
Thanks.
Problem is very clear. Laravel requires php 5.5.9 version or higher. You have two options:
Update your php5-cli package
Run composer update --ignore-platform-reqs. It will update your packages without checking your php version.

Why does running this phar file spurios characters?

I am trying to run the wp-cli on my OSX terminal. Running it on the terminal causes the following output:
PHP Version:
PHP 5.3.29 (cli) (built: Jan 7 2015 10:59:34)
Copyright (c) 1997-2014 The PHP Group
Zend Engine v2.3.0, Copyright (c) 1998-2014 Zend Technologies
Why could this be happening?

what goes wrong with Opcahce and xcache

my environment
ubuntu 14.04 , php 5.5 , nginx 1.76
i am using both opcache and xcache concurrently
PHP 5.5.19-1+deb.sury.org~trusty+1 (cli) (built: Nov 19 2014 19:33:43)
Copyright (c) 1997-2014 The PHP Group
Zend Engine v2.5.0, Copyright (c) 1998-2014 Zend Technologies
with XCache v4.0.0-dev, Copyright (c) 2005-2013, by mOo
with Zend OPcache v7.0.4-dev, Copyright (c) 1999-2014, by Zend Technologies
with XCache Optimizer v4.0.0-dev, Copyright (c) 2005-2013, by mOo
with XCache Cacher v4.0.0-dev, Copyright (c) 2005-2013, by mOo
with XCache Coverager v4.0.0-dev, Copyright (c) 2005-2013, by mOo
i am just wondering can i use both opcache and xcache at the same time .. i dont know whether this allowed or not ? I know that both do almost the same job, but not sure if that would make any difference on the performance and speed.
suggestions invited ? so can i use both ?
I have similar environment (Ubuntu 14.04, PHP 5.6, XCache 3.2, Apache). In my tests when Zend and XCache enabled, the response time is the same of the XCache only. When I disable XCache, and use only Zend OPcache the time resquest reduced in 10ms. Maybe you be try OPCache + Redis (for variables), or use only XCache if the time response not make diference for you.

Why PHP in CLI need a few seconds to start?

I got problem. My PHP 5.5.8 need a few seconds to start.
If in terminal run this command php -v, it will print version only a few seconds later (about 13). But second run prints it immediately. If i wait a little bit all the same.
What to do?
$ time php -v
PHP 5.5.8 (cli) (built: Jan 12 2014 18:50:29)
Copyright (c) 1997-2013 The PHP Group
Zend Engine v2.5.0, Copyright (c) 1998-2013 Zend Technologies
with Zend OPcache v7.0.3-dev, Copyright (c) 1999-2013, by Zend Technologies
with Xdebug v2.2.3, Copyright (c) 2002-2013, by Derick Rethans
real 0m13.375s
user 0m0.029s
sys 0m0.024s

Categories