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.*
Related
I have tried virtually everything I could for the last 3 hours. I just don't seem to get it to load on PHP. I was able to install it via brew install memcached and successfully make run it as a background service via memcached -d. But that's not really what I am looking for.
I am looking at loading it as one of my PHP modules. Running php -m on the terminal does not list memcached on it at all. Neither looking at phpinfo() or print_r(get_loaded_extensions()); on runtime gave me any luck. I am trying to officially access it in my project via something like extension_loaded('memcached'), of course, this returns a falsy value atm.
I have tried solutions like below:
How to install memcached module for php#7.1 on MacOS High Sierra?
https://donatstudios.com/OS-X-Mavericks-Memcached-PHP-Extension-Installation
Can I install the memcached PHP extension with PECL?
Most of the solutions are similar to the above linked. Unfortunately, this isn't working for me because of an issue similar to this:
Unable to use PHPIZE after update to MacOS Mojave
I also get below error when executing a make command:
make: *** No targets specified and no makefile found. Stop.
And the below error when running ./configure
checking for session includes... configure: error: Cannot find
php_session.h
Meanwhile, I also cannot attempt an install via pecl install memcached due to the error below:
configuration download directory "/tmp/pear/install" is not writeable.
Change download_dir config variable to a writeable dir to avoid this
warning
Basically everything just doesn't work. And honestly, I didn't even know how to start writing this question, so I'm just kinda throwing everything in here.
It doesn't help that there are no recent discussions about installing memcached on PHP since Catalina. A lot of resources are just 5 years old and that's not a good sign, a number of them aren't even valid solutions anymore.
I am losing my mind. Why this thing is so complicated to configure is beyond my comprehension. If someone can point me in the right direction that would be great!
So I was able to find a solution after 2 working days. What you should do is move away from using built-in Apache/PHP from macOS and use the ones from Homebrew.
Here are the descriptive step-by-step procedure I did:
1) Unload the built-in Apache.
2) Install a new Apache from Homebrew via brew install httpd and then run the service
3) Install PHP via brew install php
4) Configure httpd.conf from /usr/local/etc/httpd/, including loading Homebrew PHP module, mod_rewrite, setting up DirectoryIndex, ServerName, default Listen port, etc.
4.1) If you are using virtual hosts, set this up on /usr/local/etc/httpd/extra/
5) Configure ~/.bash_profile to use the new PHP version (test via php -v or which php)
6) Install PEAR
7) Install memcached via PEAR
I have compiled a list of links that you can use:
Apache & PHP Installation
https://tecadmin.net/install-apache-macos-homebrew/
https://getgrav.org/blog/macos-catalina-apache-multiple-php-versions
https://gist.github.com/DragonBe/0faebe58deced34744953e3bf6afbec7
Follow brew info php to configure Homebrew PHP to Homebrew Apache
Configure bash profile to use homebrew php by default
PHP --version shown incorrectly on osX
How to use the php that brew installed?
Install PEAR and configure
https://jasonmccreary.me/articles/install-pear-pecl-mac
Install memcached via PEAR
pecl install memcached then follow instructions
Or
How to install memcached module for php#7.1 on MacOS High Sierra?
https://donatstudios.com/OS-X-Mavericks-Memcached-PHP-Extension-Installation
Can I install the memcached PHP extension with PECL?
why don't you try vagrant box. You will get a virtual environment of your choice, install a ubuntu environment in minutes and you can get a LAMP or MEAN / MERN vagrant box ready made.
Steps :
1) Download and install virtualbox.
2) Download and install Vagrant
3) Go to terminal
Check if vagrant is installed or not.
vagrant -v
In order to get a ubuntu box spinning up, run these commands.
vagrant init ubuntu/trusty64
It will download you a ubuntu box in minutes.
vagrant up
vagrant ssh
Have a look at vagrant you will enjoy it.
Also there are whole lot of ready to use boxes
Vagrant boxes
Documentation : [Vagrant Document]
it seems like a little bit stupid question, but Google for one hour and cannot find it:
How to install php on macOS via brew and use in in shell.
Install is simple (if you have brew already installed):
brew install php
But after installation, when i use php -v i still see default php on mac os and not the brew's one. Shoud I Add brew php binary into PATH, bash profile, or what?
Thank you!
homebrew creates symbolic links in /usr/local/bin to pretty much every binary it installs. So the answer to your question is to add that to your path in your login profile. That will probably be $HOME/.profile and you can add a line like:
export PATH=/usr/local/bin:$PATH
Then it will be set each time you login or open a new Terminal.
So in my case, the trouble was with some access permissions on specific folders on my Mac OS, so just sharing what I learned: if it's not working, carefully examile log / error feed, there can be a hint for you!
On April 1, 2018 Homebrew discontinued the Homebrew/php tap and went with a core install approach, which means many of the extensions now must be installed with PECL. I have written a two part blog series to help with installing Apache and PHP w/ PECL on later versions of MacOS. You can find it at the link below, I hope it helps!
https://medium.com/#crmcmullen/how-to-install-php-on-macos-10-13-high-sierra-and-10-14-mojave-using-homebrew-and-pecl-ef2276db3d62
Step 1: Install Homebrew
The first step is to install Homebrew and this is a tool (package manager for macOS) that will allow us to install easily PHP and basically any other package/tools.
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
Step 2: Install PHP
To install PHP we can use the command below. The first command will automatically install the latest version of PHP which is at the current moment of writing this post version 8.
brew install php
If other versions may be preferred we can specify the PHP version and the code will look like the following.
brew install php#7.4
Step 3: The php.ini Config
The default PHP configuration should be sufficient to get started but if there are any other configurations, we can change them through the php.ini located on this path. Do note the PHP version number which in this case is version 8.
/usr/local/etc/php/8.1/php.ini
Step 4: Check if PHP is running
To check if PHP is already running we can make use of the brew services command. First, we can list the services that we have installed.
brew services list
If PHP is not started we can then run the command below to start the service in the background.
brew services start php#8.1
Step 5: Checking PHP Version
Lastly to check the PHP version do run:
php -v
By now you will have PHP running on the background process and every time you logged in to the system it will start by default. Thanks for reading and have a good try.
I am running an Ubuntu 12.04 Apache2/PHP/MYSQL server that was using a deprecated version of PHP. I realized this once I tried to install the sqlite3 extension I get an error:
Failed to fetch http://ppa.launchpad.net/ondrej/php5-5.6/ubuntu/dists/precise/main/source/Sources
Research shows me that this is no longer used and instead use ondrej/php instead. This is a production server and I need to figure out steps to replace the PPA with the correct one.
Will I need to uninstall PHP and reinstall using the new packages? If so how should I go about doing this cleanly?
Is there a way to temporarily install sqlite3 without having to change repositories completely (I do not have php-dev installed at the moment either).
First you should check if there are any compatibility issues with the version you want to upgrade to (did a quick google to find this: https://github.com/squizlabs/PHP_CodeSniffer). Then, add the repository that contains the version you want, sudo apt-get update and install the version of php you want. To switch the version apache uses, do the following:
sudo a2dismod php5
sudo a2enmod php5.6
sudo service apache2 restart
I'm running Plesk Version 17.0.17 Update #16 on Debian 3.16.39-1 (2016-12-30) x86_64 GNU/Linux
My problem is that I cant figure out how to update the global PHP version to 7.1 through Plesk
I need to do this as it is required by a package I am trying to install with Composer.
I cannot remove it because it says that "Plesk is using the old version to run" and I cant seem to change the version that Plesk uses. I can only set it for individual websites and I'm not interested in running more than one PHP version.
I have already installed the new version and I am able to run it when I create a symbolic link like this:
ln -s /opt/plesk/php/7.1/bin/php /usr/bin/php
When I do this everything works fine and the problem only occurs when Plesk updates it and overwrites the path causing me to have to do it again.
I cant just remove the old version through Plesk as it says it conflicts with Plesk itself as it uses it to run.
Summary:
I want Plesk to run PHP version 7.1 and remove the old version completely.
How can I do this?
Use this:
apt-get update; apt-get install php{X};
where {X} = version ex. 5
For PHP 5.5, PHP 5.6 and PHP 7.0:
apt-get update; apt-get install php{X};
Then update the package lists and perform the upgrade:
sudo apt-get update
Well you should make sure that no website is using the old php version. After that you should be able to remove the old php version from Plesk. You should not have to create a symbolic link manually. That can cause problems with Plesk.
Maybe better to said composer use specific PHP binary?
For example you can just add the following line into the .bashrc file from your user folder:
export PATH=/opt/plesk/php/7.1/bin:$PATH
Or
echo 'PATH=/opt/plesk/php/7.1/bin:$PATH' >> ~/.bashrc
To verify you have to relogin/recreate bash session and check $PATH variable:
echo $PATH
/opt/plesk/php/7.1/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
I had noticed that an application I have setup on heroku only shows sessions variables on random requests when I refresh the browser. I put this down to the fact the application is running on 5 dynos.
I followed the following tutorial to solve this with memcached using memcachedcloud.
https://devcenter.heroku.com/articles/php-sessions#storing-sessions-in-memcached
The issue still remains though. I am using the PHP slim framework, is there any further config I need for this? I cant seem to find anything in the slim docs.
EDIT:
I can not produce the required composer.lock file because when running.
composer update
I get the error
The requested PHP extension ext-memcached * is missing from your system.
But it is in fact installed. I can see the version from typing.
memcached -h
But it is not present when typing
composer show --platform
Depending on what platform you're running, you have to make sure you that composer updates. Even if you have memcached installed, it has to match your PHP version. Then, once installed, run composer update
For example:
If you have PHP5.6.15, get memcached with, either, brew install php56/memcached or sudo apt-get install php56/memcached.
Then run composer update.
If you have an issue installing composer on Mac, you have to enable rootless install. More info can be found here:
https://donatstudios.com/OS-X-Mavericks-Memcached-PHP-Extension-Installation
The gist of the steps to take are:
Restart computer and hold Command + R to get into recover mode
Get into the terminal from Utilities
Run csrutil disable and restart
This should be done prior to installing memcached from Homebrew.
Hope this helps.
I had a similar issue, where I was getting the same "ext-memcached * is missing" error and could not see ext-memcached when running composer show --platform.
I noticed that when I originally installed memcached, homebrew showed me various alternatives. So on Mac OSX El Capitan, I ended up installing the one that matched my PHP version:
brew install homebrew/php/php55-memcached
And then I had to add it to php.ini:
extension=/usr/local/Cellar/php55-memcached/2.2.0/memcached.so
You can get the correct version path with:
brew info php55-memcached
And then I restarted Apache:
sudo apachectl restart
It finally showed up in the composer list and I was able to update composer without error.