CakePHP3 - Apache/Server Error 500 - MAMP [duplicate] - mamp

Using the CakePHP docs, I am trying to install 3.0-beta2 using composer but I got this error:
cakephp/cakephp 3.0.x-dev requires ext-intl * -> the requested PHP extension intl is missing from your system
However, I know for sure that intl is installed (it shows on phpinfo). I'm using PHP 5.4.33/Apache 2.4.10.1

I faced the same problem today. You need to enable the intl PHP extension in your PHP configuration (.ini).
Solution Xampp (Windows)
Open /xampp/php/php.ini
Change ;extension=php_intl.dll to extension=php_intl.dll (remove the semicolon)
Copy all the /xampp/php/ic*.dll files to /xampp/apache/bin
Restart apache in the Xampp control panel
Solution Linux (thanks to Annamalai Somasundaram)
Install the php5-intl extension sudo apt-get install php5-intl
1.1. Alternatively use sudo yum install php5-intl if you are on CentOS or Fedora.
Restart apache sudo service apache2 restart
Solution Mac/OSX (homebrew) (thanks to deizel)
Install the php5-intl extension brew install php56-intl
If you get No available formula for php56-intl follow these instructions.
Restart apache sudo apachectl restart
Eventually you can run composer install to check if it's working. It will give an error if it's not.

I faced the same issue in ubuntu 12.04
Installed: sudo apt-get install php5-intl
Restarted the Apache: sudo service apache2 restart

OS X Homebrew (May 2015):
The intl extension has been removed from the main php5x formulas, so you no longer compile with the --enable-intl flag.
If you can't find the new package:
$ brew install php56-intl
Error: No available formula for php56-intl
Follow these instructions: https://github.com/Homebrew/homebrew-php/issues/1701
$ brew install php56-intl
==> Installing php56-intl from homebrew/homebrew-php

When using MAMP
1 Go to terminal
vim ~/.bash_profile
i
export PATH=/Applications/MAMP/bin/php/php5.6.2/bin:$PATH
Change php5.6.2 to the php version you use with MAMP
Hit ESC,
Type :wq,
hit Enter
source ~/.bash_profile
which php
2 Install Mac Ports
https://www.macports.org/install.php
sudo port install php5-intl OR sudo port install php53-intl
cp /opt/local/lib/php/extensions/no-debug-non-zts-20090626/intl.so /Applications/MAMP/bin/php5.3/lib/php/extensions/no-debug-non-zts-20090626/
{take a good look at the folder names that u use the right ones}
3 Add extension
Now, add the extension to your php.ini file:
extension=intl.so
Usefull Link:
https://gist.github.com/irazasyed/5987693

The error message clearly states what the problem is. You need the intl extension installed.
Step 1: install PHP intl you comfortable version
$sudo apt-get install php-intl
step 2:
For XAMPP Server intl extension is already installed, you need to enable this extension to uncomment below the line in your php.ini file. Php.ini file is located at c:\xampp\php\php.ini or where you have installed XAMPP.
Before uncomment:
;extension=php_intl.dll ;extension=php_mbstring.dll
After uncommenting:
extension=php_intl.dll extension=php_mbstring.dll

Short answer: activate intl extension in php_cli.ini. Thanks to #ndm for his input.

If you are using latest version Ubuntu 16.04 or later just do
sudo apt-get install php-intl
Then restart your apache
sudo service apache2 restart

In my case I was not actually trying to run cakephp locally, I was just trying to get it to auto update locally using composer (because I am playing with writing plugins that you install with composer). Since I don't actually even run it locally I could simply ignore requirements by adding the --ignore-platform-reqs flag.
php composer.phar update --ignore-platform-reqs

In my case, my running php version is 7.1.x on mac OSX .
I installed intl command using brew install php71-intl.
Placing extension=intl.so inside php.ini was no effect at all. Finally i looked for extension installed directory and there i saw intl.so and placed that path (extension=/usr/local/Cellar/php71-intl/7.1.11_20/intl.so) to my php.ini file and it solved my problem.

In my case (xampp PHP 8.0)
Find ;extension=intl in /xampp/php/php.ini
Remove ; and Restart Apache

MAKE this
In XAMPP, intl extension is included but you have to uncomment extension=php_intl.dll in php.ini and restart the server through the XAMPP Control Panel.
In WAMP, the intl extension is “activated” by default but not working. To make it work you have to go to php folder (by default) C:\wamp\bin\php\php{version}, copy all the files that looks like icu*.dll and paste them into the apache bin directory C:\wamp\bin\apache\apache{version}\bin. Then restart all services and it should be OK.
if you use XAMPP do this
1. turn off XAMPP
2. Modifed the php.ini is located in c/:xampp/php/php.ini
3. intl extension is included but you have to uncomment extension=php_intl.dll in php.ini and restart the server through the XAMPP Control Panel.

For Ubuntu terminal:
Please follow the steps:
Step-1:
cd ~
Step -2: Run the following commands
sudo apt-get install php5-intl
Step -3: You then need to restart Apache
sudo service apache2 restart
For Windows(XAMPP) :
Find the Php.ini file:
/xampp/php/php.ini
Update the php.ini file with remove (;) semi colon like mentioned below:
;extension=php_intl.dll to extension=php_intl.dll
and save the php.ini file.
After that you need to
Restart the xampp using xampp control.

Intl Means :Internationalization extension which enables programmers to perform UCA-conformant collation and number,currency,date,time formatting in PHP scripts.
To enable PHP Intl with PECL can be used.
pecl install intl
On a plain RHEL/CentOS/Fedora, PHP Intl can be install using yum
yum install php-intl
On Ubuntu, PHP Intl can be install using apt-get
apt-get install php5-intl
Restart Apache service for the changes to take effect.
That's it

For those who get Package not found error try sudo apt-get install php7-intl then run composer install in your project directory.

I had the same problem in windows
The error was that I had installed several versions of PHP and the Environment Variables were routing to wrong Path of php see image example

I'm using Mac OS High Sierra and none of these worked for me. But after searching a lot I found one that worked!
This may seem trivial, but in fact about 2 months ago some clever guys made changes in brew repository, so doing just: brew install php71-intl will show you error with message that such recipe doesn’t exists.
Fortunately, there is. There is temporary fix in another brew repo, so all you have to do is:
brew tap kyslik/homebrew-php
brew install kyslik/php/php71-intl
SOURCE: http://blastar.biz/2018/04/14/how-to-enable-php-intl-extension-for-php-7-1-using-xampp-on-macos-high-sierra/

I use Linux Ubuntu 20, you can try this:
Check php installed modules:
php -m | grep intl
If there are no result(s) from this command, you should just go ahead and install the module:
sudo apt-get install php7.4-intl
you will need to change *php7.4 to your desired php version.
you should restart apache when you're done:
sudo service apache2 restart

Related

How to install "stunnel" on CloudLinux RHEL Feddora CentOS yum install not working

!!JUST WRITING THIS POST SO THAT SOMEONE CAN SAVE HOURS IN THIS!!
I tried a hell lot to install this "stunnel" but was unable to do so
I was in my cpanel's terminal
What I tried all with 'sudo'
yum install stunnel
yum -y install stunnel
yum install stunnel5u
yum install stunnel4
etc BUT NONE OF THEM WORKED it just said No package stunnel found
I thought of manually install but still failed
I followed
https://developers.exlibrisgroup.com/blog/newcastle-stunnel-manual-installing-stunnel-on-centos-6/
I tried with the latest version though 5.57
But I stuck on makefile as for this entire stunnel tar package I don't know how to create a makefile
Please Help!!
I searched everywhere but I didn't find it so I tried it myself and it worked
Hope this may help others who are stuck with this in their cpanel RHEL FEDDORA CENTOS
What I did is this:
Open Terminal from Cpanel and run this
wget https://dl.iuscommunity.org/pub/ius/stable/CentOS/7/x86_64/stunnel5u-5.44-1.ius.centos7.x86_64.rpm
rpm -Uvh stunnel5u-5.44-1.ius.centos7.x86_64*rpm
This gave me sign of relief

There is no activate when I am trying to run my virtual env

1) I installed virtualenv using pip.
2) I ran the command virtualenv venv
3) Then I ran source venv/bin/activate but it says that there is no such file or directory.
When I cd into venv/bin I find 3 things - python, python 2.7, and python 3.5. Does anyone know the problem?
i have had the same problem. and what i did is just run the command
virtualenv env
again. And then more files were generated under directory env/bin, including the activate file. it's so weird.
I solved the similar problem running python3.7 -m venv venv, you can change for your version of python that is installed in your enviroment.
According to Python doc, the installation step is
$ python3 -m pip install --user virtualenv
$ python3 -m venv env
The last command gives a warning message,
The virtual environment was not created successfully because ensurepip is not
available. On Debian/Ubuntu systems, you need to install the python3-venv
package using the following command.
apt-get install python3-venv
You may need to use sudo with that command. After installing the python3-venv
package, recreate your virtual environment.
$ sudo apt-get install python3-venv
Now, activate is available.
I solved a similar problem by naming it venv2 when I ran virtualenv. I already had a virtual environment named venv for another project. This allowed me to proceed.
I experienced this problem when using the --upgrade option. Removed the option, and all ran as expected.
I double it is caused by some networking issue, I run it twice to get 'activate' script installed. Maybe first it can't connect to some source so it just abort installation.
I had this happen on rasbian when I hadn't installed python3-pip before creating the venv.

How to install earlier version of mongodb with homebrew?

I'm on osx6.8 and need to install an earlier version of Mongodb, how do I install an earlier version with HomeBrew?
The below didn't work :(
dream-2:app2 star$ brew install mongodb-2.6.10
Error: No available formula for mongodb-2.6.10
Searching formulae...
Searching taps...
dream-2:app2 star$
Edit:
I'm getting a message to explain how this post is unique compared to another one, well, the answer to the other question is super long and complex and it's specific to postgresql and doesn't really answer my question.
Note: In September 2019 mongodb was removed from homebrew core, so these instructions have been updated to use mongodb-community instead, installed from the external tap.
If your current installation is still the pre-September mongodb package then you will need to use that name when you unlink, stop, relink and start, on the lines marked with #*# below.
Another option is to simply upgrade away from the deprecated package now.
I already have the latest version of mongo installed, thanks to.
brew tap mongodb/brew
brew install mongodb-community
But I want to switch to the old version sometimes. First, install it:
brew search mongo
brew install mongodb-community#3.2
Let's stop the current mongodb, if it is running:
brew services stop mongodb/brew/mongodb-community #*#
# or if you had started it manually
killall mongod
Now I want 3.2 on my PATH instead of the latest:
brew unlink mongodb-community #*#
brew link --force mongodb-community#3.2
(Apparently it needs --force because it is keg-only.)
Now I have 3.2 on my PATH, I can start the test DB:
mongod --version
brew services start mongodb/brew/mongodb-community
# or start your own mongod from the command-line
When I am finished, I can do the reverse to switch back to the latest version:
brew services stop mongodb/brew/mongodb-community
brew unlink mongodb-community#3.2
brew link mongodb-community #*#
brew services start mongodb/brew/mongodb-community #*#
And restart again.
When trying to install old versions of something with homebrew, it's usually useful to start with brew search packagename, in this case, there's a 2.6 version available under homebrew/versions/mongodb26
So, to install that version:
brew install homebrew/versions/mongodb26
Edit
This answer has certainly become very dated. Take a look at the answer below for a valid way to accomplish this in 2021.
curl -O https://fastdl.mongodb.org/osx/mongodb-osx-x86_64-3.2.12.tgz
tar -zxvf mongodb-osx-x86_64-3.2.12.tgz
mkdir -p mongodb
cp -R -n mongodb-osx-x86_64-3.2.12/ mongodb
export PATH=<mongodb-install-directory>/bin:$PATH #path to the dir created in step 3
mkdir -p /data/db
sudo chown -R $(whoami) /data/
mongod
Addition to the excellent answer of joeytwiddle :
if you don't want to link then unlink the old version of the software, you can just run it from the "cellar" (/usr/local/Cellar/), where brew installed it.
Use ls /usr/local/Cellar/ to find the exact path of the executable. For example in my case, to run mongo shell:
/usr/local/Cellar/mongodb#3.6/3.6.7/bin/mongo
Instead of using homebrew you can use docker to install as many versions of mongodb as you want. Each mongodb can then run on separate ports.
Install docker with brew cask install docker and then open Docker.app. After docker is running, go to Terminal and install your mongodb version by selecting an image from https://hub.docker.com/_/mongo/ like so: docker run -d -p 28017:27017 --name mongo4 mongo:latest
Verify that it's running with docker ps and you can connect to mongodb from your app using port 28017. Repeat the steps with a different name and port to install more versions. Enjoy!
I was able to install it using these instructions:
Installing MongoDB on OSX for local development
Over the last week, I’ve been building our MongoDB cluster on EC2 for
production. For development, however, we’ll still need to install
MongoDB locally. I’m running OSX 10.6.8, but these install
instructions should be the same on all modern OSX versions.
Installing on OSX is much more pleasant than on EC2 (actually it’s just as easy on EC2, but since it’s a simpler setup there’s n real configuration or
head scratching).
Download the latest binary:
curl -O http://fastdl.mongodb.org/osx/mongodb-osx-x86_64-2.0.2.tgz
Note!: If
you don’t have wget installed, simply download the file above by
visiting the link in your web browser and move it into your home
directory.
We’re going to install everything under /usr/local/mongodb
to keep things organized.
Create the directories (switch 'youruser' with your home user name):
sudo mkdir /usr/local/mongodb
sudo mkdir /usr/local/mongodb/log
sudo mkdir/usr/local/mongodb/data
sudo chown youruser /usr/local/mongodb/log
sudo chown youruser /usr/local/mongodb/data
sudo chgrp staff /usr/local/mongodb/log
sudo chgrp staff /usr/local/mongodb/data
Un-tar the binaries and move them into the correct folder:
tar -xvzf ~/mongodb-osx-x86_64-2.0.2.tgz
sudo mv ~/mongodb-osx-x86_64-2.0.2/* /usr/local/mongodb/
Create a config file for mongod:
sudo vi /usr/local/mongodb/mongod.conf
Paste:
dbpath=/usr/local/mongodb/data
logpath=/usr/local/mongodb/log/mongod.log
logappend=false
bind_ip=127.0.0.1
Note: dbpath and logpath specify the path to their
respective files, logappend is set to overwrite the log file on each
start of the database server, bind_ip only allows local connections.
Create an alias so that issuing mongod always read the config file:
vi ~/.profile
Paste:
# MongoDB Alias'
alias mongod="/usr/local/mongodb/bin/mongod --config=/usr/local/mongodb/mongod.conf"
All done, you should be able to simply type mongod after you reload the shell to start MongoDB. I
preferred not to start mongod on boot, but there are other who prefer
to and there’s plenty of documentation online to show you how to set
that up with launchd and creating a .plist.
http://alexanderwong.me/post/15259867190/installing-mongodb-on-osx-for-local-development
If you want to install an earlier MongoDB version on mac. Go to the link https://docs.mongodb.com/v3.6/tutorial/install-mongodb-on-os-x/ and select the version which you want to install and its very easy to install, just give a try. There will be around 2-3 commands for installation.
For example if you want to install version 3.6
brew tap mongodb/brew
brew install mongodb-community#3.6
If you got some error
If you need to have mongodb-community#3.6 first in your PATH run:
echo 'export PATH="/usr/local/opt/mongodb-community#3.6/bin:$PATH"' >> ~/.bash_profile
Then run
export PATH="/usr/local/opt/mongodb-community#3.6/bin:$PATH"
To confirm if it successfully installed:
mongod -version

Where is mongoctl after installation?

I've installed mongoctl according to Mongolab's simple instructions, but I can't do anything with the installed package because which mongoctl resolves to nothing.
The site makes it look like pip installs some kind of command line tool, but it seems like it just installs the python package, which would be fine if all of the documentation didn't treat mongoctl as a command line tool.
What's going on?
You can add the following option to your install command to ensure that "mongoctl" exe goes to /usr/local/bin
--install-option="--install-scripts=/usr/local/bin"
Since mongoctl is already installed on your mac, you will probably need to add a --upgrade and a --force-reinstall
So try the following
sudo pip install mongoctl --install-option="--install-scripts=/usr/local/bin" --upgrade --force-reinstall
What OS are you using?
'mongoctl' should be in /usr/local/bin. Check to make sure that directory is in your PATH
-will

How to install gearman extension on MAMP

Has anyone ever tried and succeeded to install gearman extension on MAMP?
I am trying to do it on MAMP 2.x on a MAC OS X 10.6.8
You can install the server with homebrew
brew install gearman
Then download the PECL package here http://pecl.php.net/package/gearman and compile it
tar xzf gearman-X.Y.tgz
cd gearman-X.Y
phpize
./configure
make
sudo make install
Then copy/paste the gearman.so from your default extensions folder (for me /usr/lib/php/extensions/) to your MAMP extensions folder (eg. /Applications/MAMP/bin/php/php5.3.6/lib/php/extensions/no-debug-non-zts-xxxxx/)
Finally add
extension="gearman.so"
to your MAMP php.ini (/Applications/MAMP/bin/php/php5.3.6/conf/php.ini)
Restart apache and you're done
I finally made it!
Here is how:
I had to install "libevent" first,
then to install "libgearman",
and finally the extension
I I moved the gearman.so to the extensions directory of MAMP and then I added the extension in the php.ini