The MongoDB PECL extension has not been installed or enabled in MAC YOSEMITE - macos

I am trying to install mongo on mac os X yosemite, i have already installed the current version of PECL mongo db ad mongo extension files mongo.so, but still this error The MongoDB PECL extension has not been installed or enabled comes when i open any kind of localhost page, please help i have been stuck in this situation since a week, also i have tried other versions of mongo too but the error appears to be the same.

Okay i finally found the solution.
I used homebrew to install pecl extension.
then actually i was using
sudo vi php.ini
command to edit and insert the mongo.so extension
but later i downloaded sublime text edited the note and inserted the extension manually and restarted xampp

Related

MacOS MAMP and php 8.1

I am trying to get MAMP runing with PHP 8.1 but what I see as latest version for MacOS is 8.0.8, is there a way to run 8.1 ?
I have gone thru many tutorials in which they explain on how to switch from one of the installed versions but I can't seem to find a way to install additional PHP versions.
following up relating to #Quink's answer
8.1.0 is available in the dropdown (not in the picture because I already downloaded it)
then quit and restart mamp
then you can find the folder by opening phpinfo page and seeing the path
not sure if this is needed, but at this point I copied the folder and pasted it in the main MAMP/conf directory where all the other PHP versions are
I was looking for this myself. I found out that the easiest way to do this is to start your trial version of the pro. There you have the option to download/ install the php8.1 version. After this I switched back to the basic MAMP and everything is working properly
Install homebrew
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
get latest php version i.e. 8.1 for now
brew install php
Verify php
which php
php -version
now go to to /usr/loca/Cellar/php, copy php version folder you want i.e. 8.1 for now
go to Application/MAMP/bin/php and paste this folder
rename your folder like others i.e. "8.1.10_1" to "php8.1.10" in my case
at this point you can quite the mamp and reopen it and you will see php8.1 version in your mamp php version's dropdown
now go to your terminal and
/Applications/MAMP/Library/bin/apachectl start
and you will see an error i.e. Syntax error on line 160 of /Applications/MAMP/conf/apache/httpd.conf... in my case
to resolve this go to /usr/local/lib/httpd/ and copy the "modules" folder
now past it in /Applications/MAMP/bin/php/php8.1.10/
YOUR MAMP IS ALL SET BUT if you try to reach phpadmin you will see an error, for that
go to /Applications/MAMP/bin/phpMyAdmin5 and edit config.inc.php.
Locate this text: $cfg['Servers'][$i]['host'] = 'localhost' and change it to ``$cfg['Servers'][$i]['host'] = '127.0.0.1'`
Restart your server.
HOPE THIS HELP YOU
This YouTube Video answers this perfectly, and then follow this SO answer
You might also want to change your local connection host from localhost to 127.0.0.1
PS: Copy /usr/local/Cellar/php/8.<version_number>/lib/httpd/modules/libphp.so to /Applications/MAMP/bin/php/php8.<version_number>/modules/libphp.so

postgresql uuid-ossp.control file missing in extention folder. I have installed postgres 9.6 on windows 10

I am getting the below error on running this query CREATE EXTENSION IF NOT EXISTS "uuid-ossp";
SQLSTATE[58P01]: Undefined file: 7 ERROR: could not open extension control file "C:/Program File
s/2ndQuadrant/PostgreSQL/9.6/share/extension/uuid-ossp.control": No such file or directory (SQL:
CREATE EXTENSION IF NOT EXISTS "uuid-ossp")
Old question but I found it when I had a similar problem.
To install the uuid-ossp extension, you need to have some extra modules installed on the server you're on.
You can get those modules by installing postgresql-contrib, for example, on a Red Hat server, you'd do
sudo yum install postgresql-contrib
Also, note that if you need specific Postgres versions of the modules, you can do something like:
sudo yum install postgresql13-contrib
I had this problem and the first answer solved it for me.
Probably you are missing modules.
sudo yum install postgresql-contrib and try again.

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.

Building XDebug For Use by MAMP?

I'm using MAMP on Mac OSX Mavericks. I'd like to install the latest XDebug, v2.2.4. Per the XDebug Wizard, I downloaded the XDebug 2.2.4 source. I have many versions of phpize installed on my system - one that is in /usr/bin/, and many others that come with MAMP. MAMP supplies the required phpize for each version of PHP it includes.
Seeking to use the correct phpize, per the XDebug Wizard instructions - http://xdebug.org/docs/faq#custom-phpize - I ran the phpize for PHP 5.5.3 via:
/Applications/MAMP/bin/php/php5.5.3/bin/phpize
..and got this output:
grep: /Applications/MAMP/bin/php/php5.5.3/include/php/main/php.h: No such file or directory
grep: /Applications/MAMP/bin/php/php5.5.3/include/php/Zend/zend_modules.h: No such file or directory
grep: /Applications/MAMP/bin/php/php5.5.3/include/php/Zend/zend_extensions.h: No such file or directory
Configuring for:
PHP Api Version:
Zend Module Api No:
Zend Extension Api No:
Just in case this was not an error (since it appeared that I was following XDebug Wizard directions), I then ran configure via:
./configure --with-php-config=/Applications/MAMP/bin/php/php5.5.3/bin/php-config
...and I ran:
make
...but got this error:
fatal error: 'php.h' file not found
What is the correct way to build XDebug on OSX for use by MAMP?
Thanks very much in advance to all for any thoughts or info.
I had a similar issue and it was resolved after installing XCode and the Command Line Tools for XCode. I already had XCode installed, but I recently moved over to a new machine so I had to open it back up and it updated some things. Then I opened Terminal and ran the command...
xcode-select --install
That popped up a prompt to install the command line tools which I did and it resolved my issue.
Incase anyone else stumbles across this from Google...
My issue was the wrong phpize binary was found on the path.
I was able to resolve this using the Xdebug FAQ, specifically this section: https://xdebug.org/docs/faq#custom-phpize
When Xdebug wizard asks you to run phpize, instead find and run phpize in your MAMP directory. For me, this was:
/Applications/MAMP/bin/php/php7.1.19/bin/phpize
After this, you should see an output similar to your tailored installation instructions.
Then find and run php-config in your MAMP directory (Note: this command must be run from where you have Xdebug stored on your machine). For me, this was:
./configure --with-php-config=/Applications/MAMP/bin/php/php7.1.19/bin/php-config
You'll see a bunch of output... Followed by a, "Build complete." message.
Now you can return to your tailored installation instructions (be sure to skip the next step, Run: ./configure).
Try installing autoconf using brew : brew install autoconf

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

Resources