I'm trying to install Gearman on OSX (10.8.3) and MAMP PRO (2.1.1), but for some reason it's not picking up my gearman.so extension file and loading it - I can't see it in phpinfo(). I followed the steps that seem to have worked for others:
Installing Gearman:
brew install gearman
Downloading and installing the Gearman package:
tar xzf gearman-X.Y.tgz
cd gearman-X.Y
phpize
./configure
make
make install
Both of these seemed to work correctly. I copying the gearman.so file to the extensions directory shown in phpinfo(), and added:
extension=gearman.so
To the MAMP PHP 5.4.4 php.ini template. I restart MAMP and open up phpinfo() again but it doesn't show anything to do with Gearman. If I look at the loaded php.ini file, gearman.so is listed there, and is in the extensions directory shown, but it still isn't loading.
Why wouldn't an extension show up after these steps? Any idea how I can troubleshoot this issue?
Make sure you placed the gearman.so in the right folder for MAMP and make sure you did sudo make install and not just make install
I know this is old but wanted to leave a comment incase someone else found this in their search
Related
As the title says im trying to install a php extension (zip.so) that is missing from php7.1 version in ampps 3.8. I have searched for an answer but no luck so far.
Also using php5.6 and going to the php extensions list im able to see the zip extension, but since the software that im trying to intstall requires php 7.X im unable to simply use php5.6.
Thanks for the help in advance.
I finally found a way to do it:
Go to (for example) https://pecl.php.net/ and download the extension that you need.
Unzip the extension and go to the file location $ cd my/extension
Run phpize /usr/local/ampps/php-7.1/bin/phpize
Next run ./configure --with-php-config=/path/to/my/php-config for example ./configure --with-php-config=/usr/local/ampps/php-7.1/bin/php-config
make and sudo make install
In the end of sudo make install log you will find this Installing shared extensions: /usr/local/ampps/php-7.1/lib/extensions/no-debug-non-zts-20160303/ file path.
Go to the file path and you will find your compiled extension, for me it was zip.so
Finally copy the extension into your php folder /usr/local/ampps/php-7.1/lib/extensions/ext and you will be able to see it on the list of extensions in ampps, dont forget to enable it and restart apache2!
Hope it helps!
There is an easier way to do so
Open AMPPS Application ->Stop Apache (If running)
2 In "PHP" Tab -> "PHP Extension"
Enable "zip.so".
Apply
Restart Apache.
See image for clarification I am using a mac
I have gnupg and gpgme installed using homebrew.
I also linked both and made sure they are installed and linked by running brew gnupg install and brew gpgme install and got the message confirming the installation and the version.
I have placed the gnupg.so file in the extension path and also added extension=gnupg.so into the php.ini file.
I got the extension path and the specific php.ini's path from the infophp page.
After restarting mamp, I still don't see gnupg or gpgme as extensions on phpinfo, neither I can use gnupg in my php code.
using $gpg = new \gnupg(); this gives me error saying gnupg class doesn't exist.
[Symfony\Component\Debug\Exception\FatalThrowableError]
Class 'gnupg' not found
I tried another approach:
I also manually downloaded both gnupg and gpgme from their website extracted them ran following
./configure,
make,
sudo make install,
and was able to install successfully again, also made sure that gnupg.so is in the same path that shows up in phpinfo page for extension path and also added extension=gnupg.so to the same php.ini that appears in phpinfo page (I added the extension=gnupg.so right after all the other extensions in the php.ini file)
I am using:
mac os high sierra 10.13.3
php 7.1.12
mamp 4.4.1
gnupg 2.2.5 (I tried this version with brew install)
gnupg 1.4.0 (I tried this version with downloading from gnupg.org)
gpgme 1.10.0
I also would like to know, after hopefully fixing the above mentioned problems, do I need to include anything in my php file in order to use gnupg?
what are the differences between gnupg and gpgme? do I need both in order to encrypt a file in php?
if I wasn't able to fix this what is another way to encrypt xml files or files containing text data? I need to encrypt the file and FTP to another server and decrypt it over there.
Thank you all in advance for your help
I was able to solve this issue using Pecl to install GnuPG.
This link helped me a lot as well.
Run the following in order to install the library:
sudo apt-get -y install gcc make autoconf libc-dev pkg-config
sudo apt-get -y install libgpgme11-dev
sudo pecl install gnupg
Restart your server with: "service apache2 restart", or "sudo service phpX.Y-fpm-sp restart" where x.y is the major.minor version of your php. Note: there are multiple different ways to restart the system so the changes take effect, so please do your own research on how to do it depending on the server and your php version.
As I've explained in my question, try to find the right php.ini file to add the "extension=gnupg.so" into. most common places you'll find your php.ini are:
/etc/php/7.2/apache2 (you can use your PHP version instead of 7.2)
/etc/php/7.2/cli (you can use your PHP version instead of 7.2)
The better way is to find out the php.ini path that loads the extensions, from the phpinfo()
Now Verify that it all went well with the following command:
"php -i | grep -i gnup"
If everything is working as expected you'll see something like this:
/etc/php7.0-sp/conf.d/gnupg.ini,
gnupg
gnupg support => enabled
I tried to install Magento on localhost (XAMPP) for the first time today. As Magento installer does the Readiness Check an error occurs, as it is missing PHP Extension intl. I have done research, but all I can find is to remove ; from ";extension=php_intl.dll" in php.ini in etc folder. This does not work (tried to restart XAMPP and the computer several times)
This is driving me crazy, please help.
I am on macOS Sierra.
First of all, you should check with phpinfo() method to check intl loaded or not. some time may this loaded bud you are in the mistakes.
after that, check php_intl.dll existin this folder : "\xampp\php\ext"
if all of these are ok, you may check log files.
UPDATE:
Base on your update about OS,if you have homebrew available and have PHP7:
$ brew install php70-intl // For PHP7.0
$ brew install php71-intl // For PHP7.1
For PHP5.5:
$ brew install php55-intl
Re-open your terminal window to ensure it works right in your session. To see if it loaded via your CLI interpreter:
$ php -m | grep intl
Or:
$ php -i "(command-line 'phpinfo()')" | grep intl
Source: https://daveismyname.blog/blog/install-php-intl-on-mac-using-homebrew
You need to check your correct php.ini file and also create a php file with a function phpinfo() and run this file and check the extension that are not installed.
To enable/installed these extension go to php.ini file and uncomment those extension.
save this file and restart the apache/xampp
I hope it will work for you.
On my sever i successfully install phalcon version 0.6.0 through git. These are the steps i used.
git clone git://github.com/phalcon/cphalcon.git
cd cphalcon/build
sudo ./install
restart the webserver
I tried to update to version 0.7.0, so i deleted the original folder and re-downloaded the git folder. I followed the same steps, after the install i check phpinfo. It installed correctly but, it installed a previous version(0.5.2).
I tried to install the extension multiple times but, it still gives me the old version.
is there something im doing wrong, any help would be appreciated.
Find if you have any phalcon.so files laying around and they are used instead of the actual one. It could very well be that the 0.5.2 is somewhere in your system, referenced by your web server and the installation process cannot update it.
locate phalcon.so
Note: for my installation it was in /usr/lib/php5/20100525/phalcon.so
Check your php.ini or your /etc/php/conf.d folder for references to the extension. If there are some remove them.
Re-run the installation process again using the
cd build
sudo ./install
Note the script output, especially at the end. It will tell you where the extension was installed.
Note the folder and add the directive in the php.ini file and then restart your web server for the changes to take effect.
It seems that you have installed PHP 5.3 on CLI but PHP 5.4 on Apache/Nginx, make sure your 'phpize' command is pointing to the 5.4 one:
[#] whereis phpize
Once you know the correct path change the priority of the executable, delete the PHP 5.3 or add an alias in the bash console:
[#] alias phpize=/path/to/5.4/phpize
Then try to run ./install again
I've been tasked to create a PHP app which accesses an existing PostgreSQL database. This is my first time working with Postgre, not to mention the PHP has already been installed in the Linux box on which the app is supposed to run. I have no experience setting up this stuff, I just code.
My question is that I can't seem to get the Postgre extension working in PHP. I checked the php.ini file, there were no "extension=..." lines. So I added "extension=pgsql.so". I then checked the "extension_dir" and found that there were only 2 files in there (ldap.so, phpcups.so), I added a pgsql.so file taken from another Linux box. I restarted httpd. And it does not work. I couldn't find any "pgsql" or "postgre" in phpinfo().
Forgive my noobness. I know too little Linux. I would really appreciate it if you can point me to the right direction.
I used the suggestion given by number5:
Dude, I'm on RedHat. I used the "yum" version of the command you gave, and I got this:
[root#perseus ~]# yum install php-pgsql
Loading "installonlyn" plugin
Setting up Install Process
Setting up repositories
Could not retrieve mirrorlist http://mirrorlist.centos.org/?release=5&arch=x86_64&repo=extras error was
[Errno 4] IOError:
Error: Cannot find a valid baseurl for repo: extras
UNFORTUNATELY, the Linux server I'm using is NOT connected to the Internet. Any other way to install?
It depends on which Linux distro you are using.
If you are using Ubuntu/Debian, you need to:
sudo apt-get install php5-pgsql
Fedora/CentOS
yum install php-pgsql
usually you can find out which distro you are on by:
ls /etc/*-release
On CentOS extensions create separate *.ini file one per each php extension in /etc/php.d
So, don't alter main *.ini file, but create /etc/php.d/pgsql.ini and add there a line
extension=pgsql.so
Then you will need to restart Apache using
service httpd restart
But the best automated way is to just type
yum install php-pgsql
In your case that didn't work because of some problems in yum configuration. Go to /etc/yum-repos.d
Type
nano /etc/yum.repos.d/CentOS-Base.repo
Scroll down to [extras] section and ensure it is like this:
#additional packages that may be useful
[extras]
priority=1
name=CentOS-$releasever - Extras
=extras
#baseurl=http://mirror.centos.org/centos/$releasever/extras/$basearch/
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-5
Correct it if needed, save file (Ctrl-X) and do the following:
yum clean all
yum upgrade
Afterwards try to repeat
yum install php-pgsql
Remove the .so file you've copied from the other machine (though it might work, there's no need to take the risk)
Use the distribution's package manager to install the php_pgsql/php5_pqsql module
Restart the apache and try again. Maybe the module has been added to an .ini file automagically
If not, run <?php echo 'ini: ', get_cfg_var('cfg_file_path'); to see which php.ini you have to edit
edit this ini file
restart the apache
My operation system Linux mint kde and there was same issue
pg_connect()
You must install if you are use php5.6
sudo apt-get install php5.6-pgsql
After you must change extention name in "php.ini" file.
;extension=php_pgsql.dll
'dll' to 'so'
For example
extension=php_pgsql.so