I'm using an amazon ec2 instance.
When I try to access phpmyadmin I get the following error:
Cannot load mysqli extension. Please check your PHP configuration. - Documentation
It was working before, but I decided I wanted to upgrade to php 5.
I ran this command:
`sudo yum install -y php55-mysqlnd php55 php55-xml php55-mcrypt php55-mbstring php55-cli mysql55 mysql55-server httpd24`
I removed conflicts in order to get the command to run.
And now phpmyadmin does not work. I can't connect to the database anymore through my php scripts.
I have added extension=mysqli.so to the php.ini file and restarted apache.
How do I resolve this?
I figured it out. I think when I removed conflicts, I did it somewhat blindly.
Don't do something like yumo remove httpd*.
Don't be lazy like me. Type in exactly what you want to remove.
For whatever reason, my server got removed within myUrl.com/phpmyadmin/setup/index.php so I had to create a new one (luckily it kept my tables though).
If anyone wants a really good reference for installing (or fixing your blunders) I've been following this: http://www.martin-brennan.com/php-mysql-and-ftp-on-an-amazon-ec2-instance/
I used that command I posted above to install php 5 in combination with that tutorial.
Related
I want to delete PHP 7.2.7 in ubuntu I used:
apt-get purge php7.2.*
I get like around 50 I guess from these message:
Note, selecting 'php7.2-sybase' instead of 'php7.2-pdo-dblib'
Package 'libapache2-mod-php7.2' is not installed, so not removed
However when I want to install magento on the server it says at readiness check:
PHP Version Check
Your PHP version is 7.2.7. The required PHP version is 7.0.2|7.0.4|~7.0.6|~7.1.0. Hide detail
Download and install PHP from www.php.net using this PHP Documentation.
For additional assistance, contact your hosting provider.
I deleted it but there were some errors because of file permissions now I changed it. but I think some remaining files stayed behind.
How can I get rid of them?
try to use sudo command:
sudo apt-get purge php7.2.*
I'm on a Mac (OS Sierra, 10.12.6). If I run php -v, then it tells me, that I'm running version 5.6.30. And if I run which php then it gives me this path: /usr/bin/php.
I would like to run PHP7.1, - and I would like to install it using Homebrew. But before I do so, I thought it would be wise, to ensure that all old stuff, that can be removed - is removed.
I'm not running a local server or anything. But I still took a look inside this file: /private/etc/apache2/httpd.conf, - then I can see that this line is commented out:
#LoadModule php5_module libexec/apache2/libphp5.so
And I can't imagine what other programs would have PHP5 as a dependency.
I know that I can run PHP5 and PHP7 in parallel. And the answer from this post stated, that as long as your /usr/local/bin/ came before /usr/bin in my `$PATH$, then the Homebrew-PHP would be used. But it just seems a bit hacky, - to just 'put PHP7 in front of PHP5' and disregard any potential collision further down the line.
So to sum up... Can I delete my PHP5-installation? Or is it like with Python-versions, that there's a native version (2.7.x) that shouldn't be tinkered with, - and then you can install your own version somewhere else?
And if I can simply remove PHP5, - then how do I do it (I can't find that anywhere)? I haven't installed PHP5 myself, - and it's not installed with Brew. I have PhpStorm installed, - so it may have come with that.
I solved it by adding it as an alias, by writing brew info php71, finding it in the Cellar-folder, and then linking to it by adding this:
alias php='/usr/local/Cellar/php71/7.1.10_21/bin/php'
The answer was inspired by Xeoncross's answer from this article.
My guess is that PHP v. 5.6 came with PhpStorm. And I'm not sure if it will give problems somewhere, to change the php-command. If I stumble across any of that, then I'll update this post.
PHP Warning: PHP Startup: Unable to load dynamic library '/usr/lib/php/20131226/memcached.so' - /usr/lib/php/20131226/memcached.so: undefined symbol: php_msgpack_serialize in Unknown on line 0
Earlier today, I enabled forwarding of messages to root#localhost on my server to beam back to my personal email.
I have been receiving the above error message at 30 minutes intervals since. Of course, I checked and there's a PHP session cleaning script attached to cron to run at 30 minutes interval.
I have been searching around but couldn't find any specific solution.
My setup:
memcached 1.4.25
PHP 7.0
nginx/1.10.0
mysql Ver 14.14 Distrib 5.7.13
Ubuntu Server LTS 16.04
The closest I found to my issue above was this: http://community.rtcamp.com/t/php-warning-error-php-msgpack-serialize/6262 but there's no answer on that thread.
First you need to work out which PHP ini files are being loaded. From command line you can run php --ini. Technically apache/nginx can be running a different version, and you can look up using phpinfo(); exit(); test script if you want to view that one instead. As you're using cron, you're using the command line version anyway.
In one of these files you will find a line similar to:
extension="memcache.so"
If you don't need this extension at all, then just comment it out by prepending it with a ;:
;extension="memcache.so"
If you DO need the extension then it sounds like you need to rebuild this module. The easiest way is using PECL.
pecl install memcache
You might need to follow some instructions whilst running the install. Once it's done, you should be able to run php -v and it shouldn't output the same warning. If this has worked and you just see the php versions, you should restart nginx (if you need it on the website, the command line one should work instantly). :
sudo service nginx restart
I guess you can get a help from a similar topic on the site here.
But briefly, one of your extensions is loading memcache and the path in that is not correct.
You should find it in your php.ini and fix the path manually.
It means there is an extension=... or zend_extension=... line in one of your php configuration files (php.ini, or another close to it) that is trying to load that extension : ixed.5.2.lin
Unfortunately that file or path doesn't exist or the permissions are incorrect.
Try to search in the .ini files that are loaded by PHP (phpinfo() can indicate which ones are) - one of them should try to load that extension.
Either correct the path to the file or comment out the corresponding line.
Check if msgpack extension is installed and enabled (php -i | grep msgpack).
It seems that PHP in Ubuntu is compiled with it by default.
If it's installed and enabled, then check you memcached extension. Maybe you are using it from a previous installation or something similar.
tl;dr: I eventually had to clear everything PHP that is less than php7.0 from my server manually, along with their related cron jobs.
Long story:
Going through my running process (ps -aux | grep 'php'), I realized php5 is still in there running. Everything on my server uses PHP7, so that lingering process was redundant, plus there was a cron job that runs a session cleaning job on the php5 somewhere, using a script which goes looking for the so-called missing Memcached file.
After removing all phps that are less than php7 from system via apt, I also went in to delete all the existing folders that are less than php7 in /usr/lib/php5 and or /usr/lib/php/ along with their cron related jobs found in /etc/cron.d/php5 and or /etc/cron.d/php/
No more whining warnings from PHP session cleaning about memcache
I was getting a similar error with memcache.so and I noticed there was a new version of memcache that was installed the moment the system ran 'pecl install memcache' (automatically that updated to the latest version). The new version caused that error so I had to change the version 1 version lower to pecl install memcache-4.0.5.2 and it worked. Thanks #Farkie for that insight, that's when I realized that there was a new version that just came out a few days ago and that was it!
Just install msgpack extension and the error message should disappear:
apt install php-msgpack
You might also be missing igbinary extension:
apt install php-igbinary
I have been working on a Symfony2 installation on a dedicated server for the past year and I'm finally trying to get it to work on my local server (since I am spending more time meddling with the code lately).
I've created a new database and imported it. Edited the parameters.yml file to contain all the info needed by local and ran php composer.phar install.
Ran php app/console doctrine:schema:update, clear cache, install assets and dumped assetics. No errors so far.
Now, when I go to the app.php file, I am getting this error :
Fatal error: Call to undefined function Doctrine\Common\Annotations\token_get_all() in [path]/vendor/doctrine/annotations/lib/Doctrine/Common/Annotations/TokenParser.php on line 56
I couldn't find an answer by searching (could be because I am not sure what i am searching for). Has anyone encountered this issue before and know how to fix it?
Regards,
Do you have the PHP tokenizer extension enabled? Check the Symfony requirements for more information.
In Ubuntu 14.04 you could install it with
sudo apt-get install libapache2-mod-php5
Recently upgraded PHP and ran into the following error message while updating:
php_msgpack_serialize in Unknown on line 0
So first of all, never heard of this package. All searches for this package leads to a single PECL repo (which really doesn't mean anything either) - which has about zero mentions from the community.
A few more searches and I tracked the origin down to a repo for php-memcached-dev - a repository I've never seen or heard of.
Of course, I have heard of the actual memcached library repo: libmemcached
I tried looking for this module everywhere for a sign of it being a legit part of centos but i can't seem to get any good/reliable results.
Places I searched for any sign of this package and/or repository:
http://pkgs.org/
http://stackoverflow.com
http://php.net
http://centos.org
Just searched https://bugs.php.net too...
I don't want to seem paranoid here, but I'm not even sure if this is legit at this stage.
Shrug - I dunno. I'm keeping my server turned off though until I see something else. Anyone have some advice/input ?
For the paranoid (and yes, I found it from being a little bit myself), here is an ugly google search : php_msgpack backdoor (note: only has 2 3 search results. Check out the date in the 2nd 3rd. i haven't clicked it myself and would not recommend anyone else click it either) This seems to be a rkhunter search looking for the same file being reported above. Probably just a coincidence but who knows. Thought I'd push it out there anyways.
UPDATE: Well, long story short this turned out to be an issue with a version of PHP that was installed with Cent. It has been fixed with the latest version.
On Ubunu 16.04 with PHP 5.5 from the Ondrej-PPA (https://launchpad.net/~ondrej/+archive/ubuntu/php) I could solve the problem by installing the package php-msgpack:
sudo apt-get install php-msgpack
And than enabling the php-msgpack with
sudo phpenmod msgpack
Perhaps you ave to restart apache2 after that if you use it with PHP.
Than this error is gone:
PHP Warning: PHP Startup: Unable to load dynamic library '/usr/lib/php/20121212/memcached.so' - /usr/lib/php/20121212/memcached.so: undefined symbol: php_msgpack_serialize in Unknown on line 0
One last thing to check:
msgpack extension must be loaded before memcached.
In my scenario extensions were loaded alphabetically and therefore memcached was loaded before msgpack. Php cli didn't work until I loaded msgpack before memcached.
Following commands solved my issue.
sudo apt-get install php-igbinary
sudo apt-get install php-msgpack
sudo service php7.3-fpm reload #Change to your version
Reference:
https://laracasts.com/discuss/channels/forge/php-71-update-broken-memcached
If you land here in Oct 2020 because you're getting an error after upgrading and you're using the repository ppa:ondrej/php you need to install the specific version of msgpack because all-of-a-sudden memcached is looking for this shared object.
We're running php 7.3 from this repo and although php-msgpack was installed, we needed to install php7.3-msgpack (which wasn't needed until this upgrade). No need to "enable" it as mentioned in the accepted answer. Just restart php.
Two steps:
sudo apt install php7.3-msgpack
sudo systemctl restart php7.3-fpm.service
http://msgpack.org/
http://pecl.php.net/package/msgpack
https://code.google.com/p/php-msgpack/
If your codebase doesn't use MsgPack, you can remove it from the php.ini and/or smaller files that mention it in the php.d/* subdirectories.
Well, long story short this turned out to be an issue with a version of PHP that was installed with Cent. It has been fixed with the latest version.