Removing apacheinstallation from multiple package-managements - php

I am pretty new at this Mac OS thingy and I tried installing PHP54 on it. I know, there is a ton of tutorials out there and trust me, I have spend hours online reading. The problem is I am a newbie and I became impatient and just started installing from Brew, Port and compiling my own.
I really just want to start over, but I would like not to reinstall the OS and I really want to understand how to install into different folder, if I for example want different versions of PHP. (I saw that someone had that in a video tutorial, but he did not tell how to do it)
So the following is my questions to you experts:
How to remove all files from a HomeBrew-install (I think I removed some manually, so that the auto-remover don't work anymore)
How to remove all files from a MacPort-install (same as above)
How to remove the default PHP installation (I've managed to update it, but I don't think it was made correctly)
How to install a new version of PHP 5.3 along with 5.4 and 5.5
Installing MySQL and PhpMyAdmin so that it works with my PHP (I could not connect to the MySQL server the last time I installed it)
I don't think I have made any changes to the Apache-server (hopefully not)

I chose to do a reinstall of my OSX

Related

Trying to get icu4c version 64 working with PHP 5.6 on Mac Catalina

I just got handed a big project running Symfony 3.4, and PHP 5.6, that I'm trying to get working on my "new" Mac Catalina (just purchased and installed, not upgraded from a previous macOS version), and I've gotten things working up to a certain point:
our-symfony-3-project $ bin/console server:start
dyld: Library not loaded: /usr/local/opt/icu4c/lib/libicui18n.64.dylib
Referenced from: /usr/local/opt/php#5.6/bin/php
Reason: image not found
zsh: abort bin/console server:start
I was able to fix a previous similar error with needing openssl 1.0.0 (I had to compile it from source using Homebrew then link it), and I think the solution is the same here, but it appears that I need to find the library or repo or download for icu4c version 64 (not sure I'm reading this right) to get brew extract to install it (it won't any other way), or figure out how to compile it and manually get it working for PHP 5.6, and I'm not finding the library I need apparently.
I've gone through pages and pages and probably a hundred command attempts trying to fix this error... and so far the recommendations have either been outdated (due to macOS/brew changes), or just didn't work.
I'd like to know where I can find the appropriate file/download/repo to just be able to install or compile this through brew or otherwise. PS: I know we shouldn't be using old versions but I just got this job and the company will not upgrade for a while.
I'm answering this by saying that I got the repo to work on a PHP 5.6 host using MAMP Pro (and Apache, not that that's relevant)... which already had the required libraries in question.
I went through the docs on the trial version (version 6.3.2):
https://documentation.mamp.info/en/MAMP-PRO-Mac/Settings/Hosts/General/
However, unlike Homebrew, switching PHP versions across hosts in MAMP Pro doesn't overwrite PHP symlinks like brew unlink and brew link does, I have to still edit my .zshrc file aliases and my PATH to have things like php (or pecl or pear etc) point to the MAMP Pro PHP version folders to get them to work correctly with the repos, as well as with composer (which runs the php command). Even MAMP's documentation says to modify the files yourself...
I can't tell yet if this difficulty is just natural to having multiple hosts with different PHP versions configured, as I could see how multiple variations running at the same time could conflict if they're using the same system files (like /usr/local files)... which sound like system software dependencies, and I don't know that these dependencies could be relegated to their own host folders (like /Applications/MAMP/bin/php/php5.6.40 folders), or maybe I just missed something somewhere. I'll update this answer if I learn better what to do here, or will add another answer if I find a way to do them using Homebrew better.

Running PHP and MySQL with XAMPP in Ubuntu (laravel)

I'm quite new to Linux and still trying to adapt my self. I've setup my working environment all good, installed XAMPP, node, sublime, etc. But when I tried running a laravel app, the first thing that caught me was I couldn't run php.
I was confused because i had already installed XAMPP (which i thought would've done it all for me), but then I simply created a symlink in my /usr/bin to the /opt/lampp/bin/php and it all worked well (I'm not sure if that was all correct, but it worked).
Then when I tried opening the app in my browser, it couldn't find the sql driver, so I asked my self, what exactly am I doing wrong? XAMPP should have taken care of all those things (as its name suggests), but it didn't setup php and mysql as i thought it would.
Am I missing something here? Should I install MySQL driver and PHP apart from XAMPP? Because that makes no sense at all for me. I really need some basic guidance here about this whole thing, what makes it so different from Windows where I simply install XAMPP and start programming?
I need to understand that so I can have a better understanding of the system it self and fix these kind of problems my self in the future.
PS: I'm using Ubuntu 16.04 and instaled XAMPP with PHP 7.0, downloaded from official website.
Thanks everyone!
I never used xampp on linux myself so i dont know how does it work here but I can tell you what really got me good start at understanding of linux was installing whole LAMP stack myself. So i would recommend googling 'How To Install LAMP' and try to figure it out from countless tutorials.
Basically you install apache, then mysql and php, restart server and check if 'It works'.
try two things
In the folder /etc/php/php.ini
uncheck the line extension=pdo_mysql.so
or in the folder of lampp (/opt/lampp/etc/php.ini)
And to start Laravel you need start with ~/php artisan serve
in the browser localhost:8000

Apache service refuse to start on wamp 2.5

This is my issue and it has given me sleepless night.
I have been working on the wamp 2.1 server environment for the past 3 years and now i want to upgrade. I finally installed wamp 2.5 and would be willing to keep my previous wamp 2.1 version. everything looks good, because after installation, i did the following after:
Copied ?:\wamp_old\bin\apache to ?:\wamp\bin
Copied ?:\wamp_old\bin\mysql to ?:\wamp\bin
Copied ?:\wamp_old\bin\php to ?:\wamp\bin
Now, the issue is this:
Whenever i start the wamp server with the latest version, it works and the icon turns green. but whenever i try changing/switching back to the old version, all the services starts except the Apache. the icon stays orange and never turns green. whenever i click test port, it tells me your port 80 is not actually used. when i click on install service, i get this message: your port 80 is available, install will proceed. when i select remove service, it removes immediately. when i click start/resume service, nothing happens and it never starts.
What I want to achieve is this:
Some old joomla site were developed on the former wamp 2.1 and each time i tried accessing them via the new wamp 2.5, i see some deprecated functions and it display some chunks of codes. meanwhile, i have two projects that refuse to run on the old wamp 2.1, so i decided to run the 2.5. Presently, the system has wamp 2.5 running.
For 5 days now, i have been cracking my head and i have been stucked.. someone out there should please help me with a solution to run wamp 2.1 and wamp 2.5 together so i can switch version easily. or a probably solution will be appreciated.
Kind Regards !
You were on the right track copying the old Apache MySQL and PHP folders into the new 2.5 version.
Unfortunately switching to very old versions from the new ones is now a bit more hassle than it used to be because of the changes made in the version of compiler used to compile Apache and PHP.
Your old versions of Apache and PHP were compiled with MSVC6 and the new versions with MSVC11 and the 2 are not compatible i.e. an Apache compiled with VC11 wont run with a PHP compiled with VC6 etc.
So try this :-
Switch from Apache 2.4.9 to your old version, it wont start because the PHP version will still be 5.5.12.
Ignore the problem.
Now switch to an old version of PHP, thats compatible with the old Apache.
With luck it will now work.
Check you have the correct version by looking at phpinfo
If it does not come up re-do the switch to the old apache and then again to the old PHP by just re-clicking the version numbers on the relevant switch menu.
To be honest I don't know if it would be possible to restore everything to work fine. I had once similar problems - I had Wampserver and installed new PHP version for WAMP and switched to new PHP version and eveything stopped to work. I tried to change PHP version to the previous one but I had info it's not compatible with Apache and I couldn't change PHP version because of chosen PHP version.
Now I moved to easyPHP and it's much more easier, you can have many PHP versions, there's no problem with changing them.
Probably in your case the problem was not WAMP itself but PHP versions. That's why when you launched your older code you have many warnings. You should simple select older PHP version to do that or you simple have to turn off warning (maybe for other PHP version you had turned off displaying warnings by default?).
If I were you, I would move to easyPHP, dump your databases (if any) and move everything to easyPHP. Probably you won't make your installation of WAMPserver work so the other option is backup everything, dump your databases and reinstall WAMPserver but you can be almost sure similar problem occurs sooner or later when you will be switching between PHP versions.
After alot of brainstorming, I finally resolved the issue all by myself.
Though it may not look wise, but i believe it could go a long way to help others who are stucked in situations like this.
First, I started the wamp 2.5, changed all the versions to the latest ones, which is Apache, Mysql and Php... when the icon turned green, I decided to stop all services, uninstalled the services one after the other. (Apache and mysql) and exit the application by right clicking.
Secondly, I renamed the wamp which encapsulates the 2.5 version to wamp_2.5old and renamed the 2.1 folder back to wamp. i launched the wamp and installed the services back again..this time, it was a lower version. both php and apache had just one version while my sql had two. I made sure the right version of sql was selected and i installed it. I restarted all the services, the icon turned green and all my old website worked.
I tried the method vice-versa and all my latest projects worked. it might look challenging but thats my own way of discovering running multiple version of wamp.
Lastly, thanks to Özgür Eroğlu and Marcin Nabiałek.. they have been of helped.
Pleas help me flag this as useful for research..
vielen gluck.. good luck guys !

How to downgrade PHP version from 5.3 to 5.2 in Ubuntu 12.04?

I have freshly installed Ubuntu 12.04 and I have installed PHP as well. By default, it is installed with version 5.3.10 but my PHP project doesn't support PHP v5.3.10.
I want to downgrade PHP version to 5.2. How can I do it?
You would have to uninstall PHP and then reinstall an older version. However if your working on a project that your going to sell, or give to clients, or whatever the case my suggestion would be take out any functionality thats actually breaking between 5.2x and 5.3x and replace it with its new counter parts, as most people will not want to revert to older versions of PHP for any needs, and generally speaking php versions only goin in one direction, if you block yourself into 5.2 and your making software in one shape or another for people, what are you going to do next year when all the servers come stock with PHP 6? Not to mention a lot of hosted solutions try to provide the latest and greatest on there new machines, and will not revert for a single client especially on a shared hosting environment.
Anyway yea, back to your question again in your terminal under Ubuntu, you can try the following. sudo apt-get purge php5 which will then prompt you for a password, then proceed with removing PHP assuming you have the PHP package standalone and not bundled in with some preconfigured LAMP stack, but then again it should still work generally speaking so long as the version is right.
As for reinstalling it, remove purge from the command and use install. However you will need to look up the means of getting an archived version installed of PHP as apt-get will get you the latest

Ubuntu server 11.10 and PHP 5.2 for use with Drupal 6

I'm trying to figure something out:
I am using Ubuntu server 11.10 virtualized on Win7 (I don't think that matters but more info is better than less) to work on a Drupal 6 website I inherited and need to make significant changes to.
I want to set up a development copy of this Drupal website on my Ubuntu server so I can work without worrying about torching the production website.
I successfully got the production files downloaded and onto my machine, I got the production MySQL database exported and imported into the dev MySQL server, and I set up a symbolic link from the directory /home/myname/thewebsite.com to /var/www/thewebsite.com so I can easily access it.
When I got the website they didn't know the admin password so I dug around online and reset it in the dev db using phpmyadmin and finally log in.
When logging in and poking around the site there are lots of errors, which when googled lead me to believe that PHP 5.3 is causing them and that there are some modules in use that only work with PHP 5.2
After looking around a lot online and on stackoverflow there seems to be no easy way to install PHP 5.2 on Ubuntu Server 11.10. With no packages for 5.2 available through apt-get or aptitude what should/can I do?
1) Install 5.2 from source - how do I get it to interface with MySQL and Apache2? Also, I've never installed anything significant from source. Is there a walkthrough?
2) Replace the repositories with old ones? Will this work on 11.10? The newest instructions I found were for 10.04
3) Use already built PHP 5.2 packages for Ubuntu? Couldn't find these
4) Pay someone who knows more to do it for me? (Just kidding, this isn't really an option...)
Cheers and thanks for your help!
PHP dropped support for 5.2 in August 2011; operating system providers such as Ubuntu will not supply a version that is out of support, so you absolutely won't get an official copy of PHP 5.2 on the current version of Ubuntu (or any other OS).
If you're running an older version of Ubuntu (eg 10.04), you might be able to do it; it would still be a downgrade, because PHP 5.3 has been the default version for quite a long time now.
If you're on a newer version of Ubuntu, ie 11.10 as you state, it is going to be a problem for you.
The Drupal developers dropped the ball badly on this one. I guess it was because Drupal 7 tool so long to finish; they were expecting D7 to be out much sooner, and so they never bothered fixing up D6 to work with PHP5.3. As it turned out, this was a big mistake, because in fact D7 still wasn't officially released when PHP dropped support for 5.2.
But even so, they should have fixed it, because they're still officially supporting Drupal 6, so they need it to work with the current version of PHP. This is definitely Drupal's problem, not PHP's, Ubuntu's or yours.
But you still need to deal with it.
I found this question over on AskUbuntu.com, which gives an answer applicable to 11.04. It isn't quite 11.10 you were asking for, but it it a lot more recent than the best you'd found, so it might be helpful.
Alternatively, you could research exactly what it is about Drupal6 and your specific modules that doesn't work in PHP5.3. The language differences between 5.2 and 5.3 that can break things are not big, so I would expect any code changes required to be fairly small. You might find you can fix the code yourself. And maybe even submit the changes to the community -- Drupal is open source, after all.
Another tack you could take is to consider whether this saga represents an opportunity for you to move the site to Drupal 7?
This may or may not be feasible, depending on the modules you're using, etc, but if it is possible, it will solve the problem, because D7 is of course fully compatible with PHP5.3.
And just to cheer you up, I'll close by mentioning that PHP are on the verge of releasing PHP 5.4. Hopefully the Drupal devs will be more on the ball this time.

Categories