After compiling php 5.3.28 on CentOS 7 I saw that pdo_mysql is missed and I need to make another compile with pdo_mysql.
After the second compile, pdo_mysql is only available when I am executing php script from command line not from Apache.
I tried to enable the pdo_mysql.so extension in php.ini but nothing changed.
Do you know how to make pdo_mysql to be enabled when I am executing php scripts over apache (Apache 2.4.6)?
If this is a box for testing, I would suggest the following.
First, build CentOS 6. There's a LOT more support out there for that as opposed to 7.
Second, you CAN install libxml2 2.9.1 on EL6. It's just not an official build
Third, I would look into Atomic Nucleus and see if they'd let you install it for free. It's a 5.3 repo and should have what you need.
Related
I am using MAMP Pro to manage my development environments, the PHP is version 7.0.12 and is running in module mode.
I have added the pcntl module for PHP and have compiled it following the directions from this answer.
The pcntl.so file is in my /Applications/MAMP/bin/php/php7.0.12/lib/php/extensions/no-debug-non-zts-20151012 folder. Also, on my vhost I can output phpinfo() and verify that the extension is installed and additionally checked it by function_exists('pcntl_signal') which returns true.
However, I can't get it to work when running PHP from the terminal. I am using the one that MAMP installs and am invoking it through /Applications/MAMP/bin/php/php7.0.12/bin/php. However, I get the error that the function pcntl_signal does not exist.
Also running /Applications/MAMP/bin/php/php7.0.12/bin/php -i | grep pcntl doesn't output anything.
Is there a way to make the pcntl module available to PHP through the command line in addition to the one apache is using?
There are two separate ini files that MAMP uses for PHP.
One is editable through the GUI, the other needs to be manually edited. For this PHP version the extension must be added in /Applications/MAMP/bin/php/php7.0.12/conf/php.ini
After adding extension=pcntl.so into the above ini file, running php -i | grep pcntl will output
pcntl
pcntl support => enabled
Today some of my packages in Ubuntu was upgraded automatically, and I didn't think of what was actually going on.
Ever since the update, my local dev-environment doesn't work anymore. First of by not working was mod_rewrite which I had to enable again using a2enmod. But now I've run into an issue that I can't seem to resolve. My application can't seem to find the PDO MySQL driver. When running the application, I get the error failed to open the DB connection: could not find driver.
This is strange, since if I check the phpinfo() the PDO drivers do support MySQL, and the socket path is a valid path.
pdo_mysql client API version is 5.5.35 according to php info.
PHP5: 5.5.3
MySQL: 5.5.35
Connectionstring
mysql:host=127.0.0.1;dbname=MyDB;port=3306
What could be causing this?
The PHP MySQL driver (mysql.so/mysqli.so) and the PHP PDO MySQL driver (pdo_mysql.so) are two separate modules. You need both of them for PDO functionality with MySQL.
It is quite possible that one of them is missing or of an incompatible version - I do not have an Ubuntu system at hand, but on my RPM-based Linux distribution there is a separate package for each module (php-mysql/php-mysqli and php-pdo_mysql). I also expect PDO to be using the newer mysqli.so driver, rather than the obsolete mysql.so one, so you should verify that one is installed as well.
Try this:
sudo apt-get install -y php5-mysql php5 mysql-client
This should automatically restart your apache if any of the dependencies aren't installed.
Try using vagrant.
Dependencies can be isolated, upgraded and downgraded when you like.
Vagrant
The only help i can find is about XAMPP installations, but i'm running a fresh root server with Plesk and.. classical LAMP and PHP 5.3.8 - everyone is telling me that Normalizer class must be available in PHP 5.3+, but it's obviously not available in my server..
what is missing, what i have to do that the class is there and running?
Unless PHP was compiled with the --enable-intl flag, the Normalizer will not be available. Check using phpinfo(). If it's not enabled, you can either recompile PHP, adding that flag, or try the PECL installation.
See http://php.net/manual/en/intl.installation.php
If the PHP installation was provided by the OS, perhaps you can use its package manager to add the intl extension as well. With root privileges, just run something like this:
$ apt-get install php5-intl
I have a problem with pcntl installation. My PHP version is 5.4.4, I followed this tutorial:
http://cyberpunx.com/2011/11/pcntl-so-on-osx-lion-and-mamp/
But Pcntl does not load. In php error log I see:
[04-Sep-2012 22:58:16 UTC] PHP Warning: PHP Startup: pcntl: Unable to
initialize module Module compiled with module API=20090626 PHP
compiled with module API=20100525 These options need to match
How can I compile pcntl correctly? Thank you for your help!
The most likely scenario is that after the upgrade you forgot to update your php.ini to change the extension_dir.
If you have followed the tutorial to the letter, your extension_dir should be:
/usr/local/lib/php/extensions/no-debug-non-zts-20100525
Also, don't forget to restart Apache after your php.ini changes.
Finally, my solution was completely different. I removed MAMP and activated OSX built-in apache and installed MySQL.
This tutorial helped me a lot:
https://apple.stackexchange.com/questions/23751/how-to-turn-mac-os-x-lion-into-a-web-server
Then I followed this:
http://cyberpunx.com/2011/11/pcntl-so-on-osx-lion-and-mamp/
...and finally got pcntl working!
//EDIT:
another very easy solution is to download precompiled PHP for mac:
http://php-osx.liip.ch/
I'm trying to get the latest Mongo Driver to work with MAMP 1.9.6 on OS X 10.5.8.
I built it successfully from source since it seems that there are no pre-compiled releases, included it into the right directory and restarted the apache.
But PHP doesn't recognize the extension. I used the 1.0.11 driver previously which worked fine, but I need the new version, because Doctrines ODM requires it.
When I replace the 1.2.10 mongo.so with the 1.0.11 and restart apache mongo is available. I don't get what could be wrong.
Anyone had this behaviour or any guesses to get this to work?
Update: The PHP error log shows the following:
[01-Jun-2012 22:02:37] PHP Warning: PHP Startup: mongo: Unable to initialize module
Module compiled with module API=20060613
PHP compiled with module API=20090626
These options need to match
in Unknown on line 0
I'm not quite sure what it means?
2. Update:
I was finally able to sync the API version of phpize.
But now I'm not able to build the driver anymore.
I do the following:
phpize
./configure
make
sudo make install
But at the make command I'm getting tons of syntax errors. Seems that it can't find several header files.
The very first one is the zend_config.h and really I just have those other two files:
zend_config.nw.h
zend_config.w32.h
I downloaded the MAMP components to get this files. Why am I missing this one? And there are a lot of others.
I'm using PHP 5.3.5 Is there a way to get those header files from a different source?
I followed the instructions at Develop MongoDB web apps with MAMP under Mac OS X to successfully build mongo.so for MAMP with php 5.3 on OS X 10.7.3.
I'm adding this for historical purposes -- I guarantee that if you're having the same set of problems, you'll want to do this.
Personally, I had a really difficult time getting MAMP's php version to play nicely with the extension builds that I was trying to make.
I discovered that the problem was that MAMP really hadn't been set up to add extensions in general, and during the compilation of the mongo php drivers, it wasn't installing it in the right place -- so I followed the following tutorial on preparing MAMP for additional pecl and pear extensions.
After following those steps to prepare MAMP for adding extensions, you can easily install any extension.
At the part where it starts talking about adding an extension, use sudo pecl install mongo and restart apache from your MAMP interface.
I ran into the same problem when upgrading from PHP 5.3 to 5.4 and was able to solve it by following these steps:
Make sure to upgrade php5-cli as well as just php5 and php5-common
Uninstall the mongo drive
sudo pecl uninstall mongo
Re-install the mongo driver
sudo pecl install mongo