Configuring apache 2.4 with php 5.6.32 configuring with source in linux - php-5.6

I have installed httpd 2.4, downloaded .tar.gz and configured as:
./configure --with-apr=/tmp/apr-1.6.3 --with-apr-util=/tmp/apr-util-1.6.1 --enable-so && make && make install (my apr and apr-util are at /tmp location)
also I have installed php 5.6.32, downloaded tar.gz and configured as:
./configure --with-apxs2=/usr/local/apache2/bin/apxs --with-mysql --enable-fpm && make && make install
Problem is I am unable to add the fpm handler, any direction what should I do.
Should I proceed with how its described in redhat developer guide or apache wiki for FPM
Thanks in advance and correcting me, if I am doing some/lots of thinh wrong :)

Why trying to build from sources when binary packages exists in various repositories ?
Yes the PHP Configuration Tips gives you correct way to use FPM (as the Apache wiki in the SetHandler way).
The linked howto is for CentOS 7, but works for CentOS 6 using the httpd24 Software Collections.
Alternative solution is to use a 3rd party repository, such as "remi", see the Wizard instructions.

Related

Compiling MySQL 5.7.20 in CentOS 7 Issues (A Lot)

I am trying to setup a MySQL server using CentOS (No GUI) and I need to switch to OpenSSL instead of YaSSL in order to have access to the encryption tools.
The issues happen when runing the cmake. At first I got the error that cmake was not able to find boost, I fixed this adding the parameter -DWITH_BOOST.
The cmake line is as follows.
cmake . -DWITH_READLINE=ON -DWITH_SSL=system -DWITH_BOOST=/usr/local/src/mysql-5.7.20/boost/
After the adjustment I ran again the CMAKE the I got several errors.
SSL Error, cmake can not find the OpenSSL files. I checked if the library was installed, I also downloaded the tar.gz file and decompress it and pointed the cmake to the folder, none of this worked.
Can not find NUMA libraries, again I checked and it is installed, at this point I ran the system update to check for everything but this did not solve the issue.
Can not find the ncurses, the same thing, is on the system but for some reason cmake is not able to find those.
Can not fin libaio, I didn't have this one installed, I installed, ran cmake again, and again cmake was not able to find it.
I been looking around, trying to figure out all this issues, I've been joining information from different websites but still not able to figure out this.
Thanks ahead to everyone for the help.
You're facing the dependencies hell with MySQL. If you don't really need to compile from the sources, you still can install with the RPM which is much easier. The RPM method is described here : https://dev.mysql.com/doc/mysql-yum-repo-quick-guide/en/
As you're asking a ready-to-go install from the sources, this is what I just did and it worked, on a fresh CentOS 7.4 minimal, 2 vcpus 3Gb :
yum group install -y 'Development Tools'
yum install -y cmake ncurses-devel curl
curl -Ovk https://cdn.mysql.com/Downloads/MySQL-5.7/mysql-5.7.20.tar.gz
tar zxf mysql-5.7.20.tar.gz
cd mysql-5.7.20
cmake . -DDOWNLOAD_BOOST=1 -DWITH_BOOST=$HOME/boost -DENABLE_DOWNLOADS=1
make -j2
make install
After that you need to configure it, add the startup scripts, and of course secure it. Here are some additional docs :
http://howtolamp.com/lamp/mysql/5.6/installing/
https://dev.mysql.com/doc/refman/5.7/en/mysql-secure-installation.html
Perhaps try make clean; cmake clean; ldconfig then run your cmake command. Sometimes the system can't find the shared libraries, and ldconfig refreshes the library search path. This helped once when I was compiling something (emscripten?) which required a lot of libraries which I was installing as compilation errors arose.
The make clean; cmake clean will ensure that the compiler isn't looking at the old library search path when you recompile.

How do I enable the intl extension in CakePHP?

I am using CakePHP 3 and MAMP Pro server for my project. When I am trying to bake the cake, this error shows up:
Fatal error: You must enable the intl extension to use CakePHP.
I have even included intl.so and extension=php_intl.dll in my php.ini file but couldn't figure out solution for this error.
this issue was happening to me some days ago. I had installed Ubuntu 18.04 and php 7.1.
I was trying to run the comman php cake.php bake in orden to use cakephp's console but I was getting the following error message:
You must enable the intl extension to use CakePHP.
This extension (intl) was installed for php 7.1 (php7.1-intl) but this message was appearing every time I used php cake.php bake
After some google searches, I saw that I have to install the extension but with the following command:
sudo apt-get install php-intl
The same issue happened with mbstring extension, I used the command:
sudo apt-get install php-mbstring
then I restarted the apache server with:
sudo service apache2 restart
It's difficult to pinpoint exactly what's wrong without seeing your system setup. However based on what was said in the question, you may be setting up the intl extension incorrectly.
First off, if your OS is Linux/macOS and the PHP extension is a shared library (i.e. has a .so extension) then the php.ini entry should be extension=intl.so not extension=php_intl.dll. Also make sure the intl.so file is in the directory configured under the ini entry extension_dir. Otherwise make sure the extension ini entry is fully qualified (e.g. extension=/path/to/extension/dir/intl.so).
If you are using a Linux OS that has a package manager such as Debian/Ubuntu, you may be able to more easily install the extension for the PHP packaged for that distro. For example, in Ubuntu/Debian the package php5-intl provides the intl extension for PHP5 (I assume it's something similar for PHP7 if you've enabled those repos).
If you build PHP from source, you can try bundling the extension into your PHP. See the instructions from the manual.
I faced the same issue.
I added extension="php_intl.dll" in php.ini and restarted the Apache server.
Now it is working.
I had the same issue. After starting from scratch, I did :
$ brew install php
$ composer install && composer update && composer dump-autoload --optimize
$ composer self-update && composer create-project --prefer-dist cakephp/app:^3.8 cms
$ cd cms
$ bin/cake server
And it was working !

Add mod_mysql, mod_xml and mod_zlib to apache

I was in the process of Anahita installation - a platform for social networking. In its requirements there is a line which says:
Apache 2.0+ (with mod_mysql, mod_xml, mod_zlib) or Nginx
You can find its main website here and its installation guide here
I installed apache2 (ubuntu 14.04) but when I go to /etc/apache2/mods-available there are no mod_mysql, mod_xml or mod_zlib.
how should I add these modules to apache?
I couldn't find them in modules.apache.org
When they talk about "mod_mysql, mod_xml, mod_zlib" they are not talking about Apache modules but rather about php extensions also sometimes called modules. Go to php.ini and enable mysql, xml-rpc and zlib. Depending on your platform and php distribution you may need to download correct libraries and configure the PATH to your php and mysql.

phpstorm cannot find class ZMQContext

Hi I'm creating project according to Tutorial on Ratchet website.
I installed zeromq version 0.3.0 through composer in phpstorm.(I checked if I installed right zeromq with phpinfo() and also with php-m in terminal)
In file post.php I cannot create new object of class ZMQContext(). - php storm cannot find this class.
I found the same issue on stackoverflow but solution is for linux.I'm using win.
When I want to use this in code: use React\ZMQ. - I don't see there class ZMQContext
Thanks for answer.
You can get PHPStorm to auto-complete code that uses the ZMQ PHP extension.
Save this stub file: https://gist.github.com/Mikulas/c22e44a918c7af5de5e6
I saved it (on OSX) under /Applications/PhpStorm EAP.app/Contents/plugins/php/lib/extensions/zmq.php
Then go to PHPStorm > Preferences > Languages & Frameworks > PHP > include path and add that extensions folder.
Now go back to your file and you'll see PHPStorm auto-completing stuff from the ZMQ extension.
Have fun! I hope you'll find this useful.
It looks like you've installed the PHP PECL extension. You also need to install the ZeroMQ library on your system that ext-zmq will use. If you're an a Debian based system try sudo apt-get install libzmq-dev or a RH based system sudo yum install zeromq zeromq-devel.

about mysql installation in a LAMP environment

When I build a LAMP environment in ubuntu-12.10,
first I installed mysql by mysql-5.5.12.tar.gz,but it told me that it can not find configure
file,it was here:
root#tryandchange-QTH6:/usr/local/src# cd mysql-5.5.12
root#tryandchange-QTH6:/usr/local/src/mysql-5.5.12# ./configure --prefix=/usr/local/mysql
bash: ./configure: 没有那个文件或目录(not exists the document or the file)
who can tell me why?Or tell me that a good way to build a LAMP environment,
but not 'apt-get install'.
XAMPP has downloadable Linux binaries, you just download, extract and run /path/to/xampp/xampp start - I'd recommend those as the easiest way to set up a LAMPP stack.
Link to XAMPP for Linux
Obviously by eschewing the use of apt, you are working with the knowledge that your apache/php/mysql will become obsolete and you will have to work to keep them secured and up-to-date.