Install fpm separately for PHP 5.5.8 - installation

I'm doing a manual LAMP setup to learn more about working with the terminal and network configuration, and upon installing the latest version of PHP (5.5.8) I realised that I missed installing fpm. I've been trying to install the extension by itself but I'm not sure how to.
Running php-fpm -v tells me I have version 5.4.17, should fpm's version be the same as PHP in order to work together?

If you are using the manual configure option, ensure you have set the --prefix=/path/to/php-5.5.8 and --enable-fpm. And you can run /path/to/php-5.5.8/bin/php after installation.

Related

I am trying to install civicrm on my Mac and I got error in step no 5

I am trying to install CiviCRM on my laptop through Drupal 8.
please help me with this error.
This is simply that your version of PHP doesn't have the intl extension compiled in.
How you address this, very much depends on how you've installed PHP on your system or, if you haven't at all (and are using the built-in system PHP).
I'm just going to pick a generic route here, and assume this is OSX PHP as some versions don't come with intl support (e.g. PHP 7.3 shipped with macOS Catalina) and say ... Save yourself some time and just use Homebrew to do this. Follow the instructions to install brew, then install your required version of PHP using;
brew update
brew install php#7.3
brew link php#7.3
It likely already has intl support, you can test by using;
php -m | grep intl

Issue in installing Mcrypt extension in mac OS 10.13

I am trying to run codeigniter project on mac but it is showing "The Encrypt library requires the Mcrypt extension." error.I have tried many solutions to install Mcrypt extension but every time i am getting errors.I have tried to install it using homebrew using brew install php5-mcrypt command but getting No available formula with the name "php5-mcrypt" error everytime.Issue is i am new to mac so now I am stuck because i don't know how to solve this issue. Can anyone help me and give me guidance that exactly what should i do to install Mcrypt extension? I am using PHP version 7.2.4 and macOS 10.13: High Sierra (Lobo).
I would recommend you try MacPorts. It's like Homebrew but I've had better luck recently. There is a port for php72-mcrypt if that's the one you are after. There are many others available as well. The MacPorts home page, found here gives instructions for loading MacPorts and also has a list of available ports.
mcrypt has been removed from PHP core since 7.2. To install mcrypt in PHP 7.2, you have to install via PCEL. The command is:
sudo pecl install mcrypt-1.0.1
You might want to read the official installation documentation as well.
For mac users install MAMP pro and select a php version that has mcrypt.
That is to say any version before php 7.2 .
Start the servers and voila you’re good to go.

OSX Apache using wrong version of PHP

I followed a guide which used home-brew to install the lastest version of php (5.4.8) on OSX Mountain Lion.
I then followed a guide which showed me how to setup and use the pre-installed apache on OSX.
However when I try running up a base Symfony 2 project I get a bunch of errors relating to missing date.timezone in the php.ini.
However I have this correctly setup the php.ini but doing a quick phpinfo() in the Symfony project shows that its using the old preinstalled version of php (5.3) rather than the new one.
In terminal if I type which php & php -v, It shows the correct new version is being used.
But the phpinfo() shows
Did you follow all the instructions provided in the Caveats?
Run brew info php54 to see them again.
Especially the line:
To enable PHP in Apache add the following to httpd.conf and restart Apache:
LoadModule php5_module /usr/local/Cellar/php54/5.4.8/libexec/apache2/libphp5.so
Apache is not aware of the homebrew version of PHP (i.e. /usr/bin/php). You see it on the command line because you've likely modified your PATH (i.e. /usr/local/bin/php).
You can modify this in your httpd.conf file.
I am not a fan of homebrew or other package libraries. Primarily because Mac OS X is built atop Unix. Furthermore, all but MySQL are installed natively. Here's an article on installing Apache, MySQL, and PHP on Mac OS X.
Disclaimer: I wrote that article.
Today I have same issue for updating php 7.2 to 7.3 as requirement of Laravel 6. Here is my solution.
Open your httpd.conf file in "/etc/apache2/http.conf"
Search (Ctrl + w) for "LoadModule php"
Uncomment that row
Restart your apache with "sudo apachectl restart"
Then, your php version in local web server (apache2) will be updated

How to make deb packages for my server?

I have a Ubuntu (12.04 LTS) install for my desktop, and I have two VPS servers that run Ubuntu (11.04 LTS) as well. I have PHP running on these servers using fcgi, but I want to upgrade to the lastest version of PHP (5.4.3) and include the modules that I need baked right in. It just so happens that the regular ./configure script happens to include all of the things that I need. So from here, I want to make a deb package that I can use on my two VPS servers so that I can quickly install it using apt-get install php. What do I have to do in order for this to happen?
I would be making the package from the desktop installation that I have (Ubuntu 12.04 LTS) and distributing them to my servers via ftp or setting up a lunchpad account. The desktop is a stock install, and the only extra thing that I added was the lib2xml-dev so that I could compile php. The servers are also bare, only running 10 proccess, including nginx, and php-cgi.
Download and build the source package from Debian testing; they currently seem to be on PHP 5.4.4. (You may need to add some backports etc, though.) Set up your own repository and add it to /etc/apt/sources.list.d on the servers. You may need to build on a 11.04 box in order to be able to install on 11.04 (or play tricks with versioned dependencies).

How was my running php compiled?

I'm trying to compile a new instance of PHP (5.4.0) from the source code and want to keep compatibility with the one (PHP 5.3.6-13ubuntu3.6) already installed from the distro, Ubuntu-11.10. That is, I want to run ./configure with the same directives as the installed PHP.
I always could see the ./configure command outputted by phpinfo() but this time, for my surprise, it's not provided.
Do you know of any flag that prevent phpinfo of outputting the compile configuration? Or,
Do you know of any other way to get how PHP was compiled?
Original answer
There should be a script php-config you can install on ubuntu to get the configure parameters used for php.
sudo apt-get install php5-dev
php-config --configure-options
2023 Update
The php-config executable is currently present in the generic package phpX.Y-dev, where X and Y is the major and minor version of the php package installed on your system. Also, the name of the executable reflects your php version.
sudo apt-get install php8.1-dev
php-config8.1 --configure-options
A list of popular ubuntu version and corresponding package:
Ubuntu 18.04: php7.2-dev
Ubuntu 20.04: php7.4-dev
Ubuntu 21.04: php7.4-dev
Ubuntu 21.10: php8.0-dev
Ubuntu 22.04: php8.1-dev
Ubuntu 22.10: php8.1-dev
Ubuntu 23.04*¹: php8.1-dev
*¹ Lunar Lobster nightly, scheduled to be released as 23.04
According to this bug report, the Configure Command output was intentionally suppressed from Ubuntu & Debian PHP builds.
Then recommend installing the source package via apt-get source php5:
If you want to see how PHP is built in Ubuntu, apt-get source php5,
and peruse debian/rules, the ./configure output in phpinfo() is, as the
changelog for the patch states, entirely misleading and not terribly
informative.

Resources