apache eaccelerator build php version - php

I'm trying to get eAccelerator 0.9.6.1 installed to speed up my Magento site.
Pretty vanilla install per the directions here:
http://docs.moodle.org/24/en/Installing_eAccelerator_In_Ubuntu_Server
Unfortunately, php -v does not show eAccelerator, and apache error log shows on restart after install:
[eAccelerator] This build of "eAccelerator" was compiled for PHP version 5.3.10-1ubuntu3.7. Rebuild it for your PHP version (5.3.10-1ubuntu3.8) or download precompiled binaries.
/usr/bin/php-config shows
version="5.3.10-1ubuntu3.8"
make test says
PHP : /usr/bin/php
PHP_SAPI : cli
PHP_VERSION : 5.3.10-1ubuntu3.8
ZEND_VERSION: 2.3.0
PHP_OS : Linux - Linux libatio 3.2.0-29-generic #46-Ubuntu SMP Fri Jul 27 17:04:05 UTC 2012 i686
phpinfo shows eAccelerator section with nothing enabled.
eAccelerator control.php shows no data.
What am I missing here? Seems I am compiling for the correct php, but apache disagrees?
Thanks,
C

No secret here except repeated reinstall with another copy of the same distro, although in the meantime I also installed Zend Optimizer and IonCube php loader.
Cheers ,
C

Related

XDEBUG installation reading wrong PHP version

I have an Ubuntu 16.04 vagrant box running on php 7.1. When I try to build xdebug by running ./configure in xdebug-2.6.0 I get
Check for supported PHP versions... configure: error: not supported. Need a PHP version >= 7.0.0 and < 7.3.0 (found 5.5.9-1ubuntu4.24)
PHP -v yields
Xdebug requires Zend Engine API version 320170718.
The Zend Engine API version 320160303 which is installed, is outdated.
PHP 7.1.15-1+ubuntu14.04.1+deb.sury.org+2 (cli) (built: Mar 6 2018 11:27:08) ( NTS )
So the system is running 7.1, but for some reason the configure script thinks we're still on 5.5.9
I've hit google pretty hard, but still can't find a way to update the Zend engine either.
Any ideas?
It happens because you're configuring with default settings and that is different from the PHP version you're trying to configure.
Just like you saw the PHP version using the php -v command, check the php-config version using the php-config --version command, it should be the same as php -v, but in your case, it would be different and hence this issue.
Now let's talk about how we can solve it. Since you need a different version of config, you should point that to the configure command.
For example, in your case, you need php-config7.1 (because you're using PHP v7.1, similarly for 7.2 you have php-config7.2 and so on)
To point the configure command to a specific PHP version you need to specify that as a flag called with-php-config and the value should be the location of the php-config file, a sample would be
./configure --with-php-config=/usr/bin/php-config7.1
Hope this solves the problem.
I assume you run phpize before running ./configure. Instead you need to run phpize7.1 and then ./configure
if you don't have phpize7.1 installed you can install it via:
sudo apt install apt install php7.1-dev

Apache2 using PHP 5.4 while 5.6 is installed

I'm currently using Raspbian Wheezy 7.0 right now. Since PHP 5.6 is not available on the apt repositories for wheezy, I decided to build it from source. The build worked perfectly, I didn't receive any errors from it.
So when I used php -v it gave me the following output.
PHP 5.6.10 (cli) (built: Sep 18 2016 09:23:21)
Copyright (c) 1997-2015 The PHP Group
Zend Engine v2.6.0, Copyright (c) 1998-2015 Zend Technologies
Ok, I thought. Perfect, everything is updated like it should be.
Here's where the problem comes in. For some reason, when I use phpinfo() on my apache2 server. It says that I'm still on version 5.4.45.
My first guess was that the module apache was using libphp5.so located in /usr/lib/apache2/modules/ was out of date. But, I have no idea where the libphp5.so module is for the new php version that I just installed is.
It'd be great if anyone could help me with this or point me in the right direction. I'm using Apache version 2.2.
As you can see from your console, php -v is the CLI binary. When building PHP you can build many different binaries for different SAPIs (Server APIs), one of them being CLI. Apache2 Handler or mod_php would be another one. In order to build your PHP as an Apache httpd module you need to make sure you include the --with-apxs2 configuration option when compiling from source. This means running ./configure --with-apxs2 before you make; make install; the binary. You then need to make sure to load the newly built libphp5.so or mod_php.so (however you built it) to the appropriate directly and load it from your Apaache httpd config. Where your newly compiled binaries are stored, depends on your compile time configuration options and environment, but typically they are located in $PREFIX/$HOME/bin. So for example, if you compiled --with-prefix=/usr you might get /usr/php/bin/libphp5.so, but typically the binary is moved for you by make install. You do need to make sure you restart httpd for the newly built binary to be loaded.
See the PHP manual on installation for more details.

Compiling PHP Intl extension on Mac Book Pro (El Capitan 10.11.4)

I am trying to install the PHP Intl extension on my new Mac (El Capitan 10.11.4) using PECL, but there is a linking error during the make stage.
Here are the steps I took:
Installed PEAR to run on Mac
Compiled and installed the ICU library (version 51.2) into /usr/local/lib
Ran this command: sudo pecl install intl and there was an error (see below). I also tried compiling the extension directly from the PHP source code ("ext" folder) and received the same error message.
I am getting the following error:
ld: file not found: libicudata.51.dylib for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make: *** [intl.la] Error 1
ERROR: 'make' failed
It looks like:
The file is missing (even though it knows the correct ICU library version to look for). Maybe it truly can't find the file. The -L switch and related switches appear to point to the correct path /usr/local/lib path.
Then, there is also some sort of architecture mismatch. So, I ran file libicudata.51.dylib and it appears to be the right architecture.
Here is what file retuned:
$ file /usr/local/lib/libicudata.51.dylib
/usr/local/lib/libicudata.51.dylib: Mach-O 64-bit dynamically linked shared library x86_64
Has anyone run across this before? Or know how to compile PHP's Intl extension on the new Mac Book Pro (El Capitan 10.11.4)? I a hoping for some hints on where to look next, because I am a bit stumped here.
Maybe you can try just this:
brew install php56-intl
You might consider looking at these threads (https://github.com/Homebrew/homebrew-php/issues/1701) and (https://github.com/Homebrew/homebrew-php/issues/1710). I tried to reproduce your error but I failed. The most probable reason would be an icu4c that is not linked.
Try using brew link --force icu4c
I tried using php70 and
sudo pecl install intl
failed. I tried using php56, everything ran smoothly.
Try running php -v master, something like this should show up
C02QH2D7G8WM:workspace userone$ php -v master
PHP 5.6.20 (cli) (built: Apr 1 2016 08:53:48)
Copyright (c) 1997-2016 The PHP Group
Zend Engine v2.6.0, Copyright (c) 1998-2016 Zend Technologies
Try run:
brew install homebrew/php/php56-intl
I fixed this problem,here is my environment:
OS : El Capitan 10.11.4
PHP : php-7.0.5
icu : 55.1
the key point is reinstall ICU using --enable-rpath:
./configure --prefix=/opt/oss/icu --enable-release --enable-shared --enable-rpath --enable-tools
If you want to know why,please run as root
otool -L $YOUR_ICU_PREFIX/lib/libicudata.dylib
to check if the first library is absolute path.

Codeigniter - Setting up cron job, not working

I'm trying to follow the cron job setup as seen in the documentation but I keep running into an issue. In the command line it output all of the markup in the header.php with the following statements at the end:
<h1>An Error Was Encountered</h1>
<p>The MongoDB PECL extension has not been installed or enabled</p>
What I'm typing into the command line:
php index.php tools message
Is there something I need to install on the server? Here are my specs from pecl version.
PEAR Version: 1.9.4
PHP Version: 5.3.10-1ubuntu3.15
Zend Engine Version: 2.3.0
Running on: Linux lucrum 3.8.0-29-generic #42~precise1-Ubuntu SMP Wed Aug 14 16:19:23 UTC 2013 x86_64
I don't have the rep to add this as a comment so i have to post as an answer. But judging from what you posted the error message is telling you that the MongoDB PECL extension hasn't been installed on your server. Have you checked to see if it actualy is installed? If it is then you need to look into your configuration.

How to install amqp on windows

I am having this error while installing pecl/amqp
when I type in the command line: pear install pecl/amqp
WARNING: php_bin C:\xampp\php.\php.exe appears to have a suffix .\php.exe,
but
config variable php_suffix does not match
ERROR: The DSP amqp.dsp does not exist.
I need to install this so that I can use amqp (RabbitMQ) on php.
# AMQP installation php.net:
Note to Windows users: This extension does not currently support Windows since the librabbitmq library does not yet support Windows.
But here at RabbitMQ website is a windows installer...
Apparently the information on the php.net page is outdated
To install do like this:
Download the correct package for your php from this official PECL amqp page
unzip
add php_amqp.dll to your php ext folder and enable the extension inside your php.ini file: extension=php_amqp.dll
add rabbitmq.#.dll to your windows system 32 folder (where # corresponds with the version number).
All this according to the post on the blog I found here.
UPDATE
I updated some of the information above. The blog post is from 2013, and only mentioning older versions, but it is anyway a nice guide to the steps you need to take. Since then newer versions are available so be aware there are some slight differences in the process (mainly version numbers) if you want to install a newer version.
This works for me in PHP 7.1, and amqp 1.9.4 for Windows.
Download the correct package in https://pecl.php.net/package/amqp based on your PHP version, architecture, thread safety, and compiler. You can check it in phpinfo
Copy php_amqp.dll to your php ext folder
Update your php.ini with: extension=php_amqp.dll
Copy rabbitmq.4.dll to your windows system 32 folder if 32bit system. add it to SysWOW64 if using 64bit system.
Restart apache.
On Windows 10, build 19041 (2004 update), 64-bit.
Using Xampp with PHP 7.4.8.
Go to here and download your relevant version: https://pecl.php.net/package/amqp (check which version you need in CLI using php -v)
From the .zip, copy the rabbitmq.#.dll to C:/Windows/System32
From the .zip, copy the php_amqp.dll to C:/xampp/php/ext (or simply your php/ext folder if using something else than Xampp)
If you've got PHP running as a service with Apache, restart Apache. If you're using it via CLI (e.g. via Bash and/or Symfony CLI server) then you're already good to go.
Other posts mention the 64-bit variant to have the rabbitmq.#.dll (where # is the version) to go in C:/Windows/SysWOW64. I tried that, didn't work for me, even though running 64-bit Windows and PHP.
$ php -v
PHP 7.4.8 (cli) (built: Jul 9 2020 11:30:39) ( ZTS Visual C++ 2017 x64 )
Copyright (c) The PHP Group
Zend Engine v3.4.0, Copyright (c) Zend Technologies
Although this will not answer how to install RabbitMQ with the pear install pecl/amqp, but have you ever tried to use rabbitmq with the pure php implementation php-amqplib?
After many hours of search: To install amqp to php7.4 & Windows 10 (https://pecl.php.net/package/amqp),
Choose the good file (x86,x64,ts,nts)
php -i or phpinfo() (Architecture => x64)
php -i|findstr "Thread" (ts or nts enable)
Copy rabbitmq.4.dll and rabbitmq.4.pdb files to PHP root folder php_amqp.dll and php_amqp.pdb files to PHP\ext folder
Add extension=amqp to the php.ini file
check php -m if you show amqp (php -v to show errors)
Big thank's to Rezende (tutorial)
If you are on Windows, on this Url you can download the installable rabbitmq and here is the direct download link for RabbitMQ 3.9.11.
You can also use choco to install it using:
choco install rabbitmq
And since, rabbitmq is implemented/written in erlang you also need erlang to be able to install rabbitmq and its services. Make sure you download erlang and install it.

Categories