macOS Sierra 10.12.2 Apache not working - apache

I've upgraded to the current version of macOS. I want to work with Apache. Well, my problem is, that when I try to access localhost with or without ~Username, I get an error message saying ERR_CONNECTION_REFUSED on Chrome or "Can't open Page" on Safari. Apache is running and apachectl configtest says "Syntax OK".
I placed the current version of phpMyAdmin into /Library/WebServer/Documents and tried to access it, same problem.
I followed the steps in this guide without a solution for me
Apache localhost/~username/ not working
So does anyone know what problem I'm facing? I'm clueless right now.

I had the same outcomes as above, using virtual hosts though, and after updating to macos 10.12.2 was receiving ERR_CONNECTION_REFUSED.
My original setup is based on the excellent posts here: https://getgrav.org/blog/macos-sierra-apache-mysql-vhost-apc
And as such, because I'm using Homebrew, all I needed to do was also run brew upgrade on CLI followed by sudo apachectl restart and I'm back up and running.

Related

How to Configure PgAdmin4 to Use Apache2 from LAMPP?

I installed LAMPP on my Ubuntu 20.04 machine. I also installed PgAdmin4 to work with my Postgresql 14. The problem is, both LAMPP and PgAdmin4 installation came with their own Apache2. This cause error for me, as in the development process, I use 127.0.0.1/pgadmin4 and localhost/ at browser interchangeably.
For now, each time I need to edit psql database in PgAdmin4, I need to turn off LAMPP using sudo /opt/lampp/lampp stop command and to turn on pgAdmin4 with sudo /etc/init.d/apache2 start. And vice-versa if I need to test the website output in LAMPP localhost.
Is there any way around them? How to configure pgAdmin4 to use Apache2 from LAMPP? Or to Install pgAdmin4 without the packaged Apache2?
I already tried using PhpPgAdmin 7 instead, but it keeps getting error.

XAMPP Can't Start Apache After Upgrading to PHP7.1.17 "Attempting to start Apache service..."

I have XAMPP installed on Windows 7 virtual machine. My old PHP version was 7.0.9 with Apache 2.4
I needed to upgrade the PHP version to 7.1.x and I set out reading about how to best to this. In end, I settled with the simple plan:
Stop Apache service
Downloaded new PHP version from official php website. For PHP 7 the 7.1.17 version was listed. I downloaded the thread safe version, as my Apache has thread safety enabled.
I extracted the contents of the downloaded archive to a folder.
I copied and replaced all files in the appropriate folders from C:/Server/php with the new php version files from the extracted archive.
I attempted to start Apache from the XAMPP control panel and the server will not start.
The message "Attempting to start Apache service..." just hangs and nothing happens.
The last entry in the error.log file in C:\Server\apache\logs shows the event when the server was stopped and that's it.
When I check the php version from CLI with the command php -v, the console returns installed php version 7.1.17
I tried different suggestions I read from similar questions, like changing ServerName localhost:80 to ServerName localhost:8080 and copying php7apache2.dll to apache/bin ( as suggested here: Upgrading PHP in XAMPP for Windows? ), alas the issue is not fixed and Apache does not start.
Of course, I also restarted the virtual machine, all the same.
At this point, I'm dumbfounded. Don't know what to do.
I need to get Apache running with php 7.1, as it is required by Magento 2.2.4. I do not want to reinstall XAMPP, as this will be a lenghty process with a lot of risk for more things to go wrong.
Any help is much appreciated!
Alright, so after checking Windows Logs > Application in Event Viewer I saw the error ".. the Apache service named is not a valid win32 application". I downloaded the x86 version of PHP from official website PHP for Windows
Then copied and replaced files as described above, and Apache started successfully.
To see if your Apache version is x64 or x86 open command prompt and cd to your Apache bin directory, in my case C:/Server/apache/bin , then run:
file httpd

Laravel Valet+ all sites yield "undefined function apcu_fetch()"

I did something stupid and while in the middle of a valet use 7.1 process, I pressed ctrl-C. In an attempt to get everything working since then I uninstalled valet+, did a composer global update, a brew update, valet fix, and valet install yet still every site I visit just spits out "Fatal error: Call to undefined function apcu_fetch() in /Users/n8klatt/.composer/vendor/weprovide/valet-plus/server.php on line 37". Any ideas on how I can get Valet+ working again?
(The initial error after interrupting the valet use 7.1 call was "Unable to determine linked PHP", which I remedied with a brew link --force php#5.6 since 5.6 was what I had been using. That allowed me to proceed with the valet use 7.1 but then all my sites started throwing that apcu_fetch error.)
So you're experiencing 2 problems here:
Call to undefined function apcu_fetch() is most likely caused by having PHP-FPM run your webserver on a different PHP version as your CLI. Makes sure your webserver is running the same version as your CLI. An easy was to check this is adding the PHPINFO within the server.php file and check the result. Often restarting your PC allows old PHP-FPM instances to die.
Unable to determine linked PHP is an error thrown when you're running on a native PHP version which is not installed by brew. In this case valet-plus cannot find the correct version number of your PHP installation and throws this error.
Solutions:
Make sure APCu is installed correctly as mentioned in weprovide/valet-plus#133
Make sure your PHP installation is not faulty as mentioned in weprovide/valet-plus#127
Hope that helps, if not give me a comment.
I had the same problem with php56. But I'm not using valet, after I reinstall the PHP56 with brew, and it added pear and pecl module. I installed apcu (couldn't install apc directly) with pecl channel-update pecl.php.net and pecl install apcu-4.0.11.
After that installation added extension="apcu.so" in php56 .ini file, which points to /usr/local/Cellar/php#5.6/5.6.38/lib/php/20131226/apcu.so where the image does not exist really because it was installed by PECL, so I had to change php56 .ini to apcu extension to match extension=/usr/local/lib/php/pecl/20131226/apcu.so where the image file resides for real, and then restart apache and it works.

MAMP - Apache couldn't be started

I am running Yosemite 10.10.1 however had the same problem on Lion prior to upgrading (thought it would fix it!). Apologies if this has already been answered but I have searched hi and low and cannot find anything...
I have tried updating to the latest version of MAMP and renamed the envvars file, both have not fixed the problem.
When I start MAMP (not MAMP pro), it opens, when I click to start the servers I get "Apache couldn't be started. Please check your MAMP installation and configuration".
Please someone help this has been driving me crazy, any help would certainly be appreciated!
Had the similar problem-
Do the following
Rename the file “envvars” located in /Applications/MAMP/Library/bin into “_envvars”
In the file "/Applications/MAMP/conf/apache/httpd.conf" remove the line
LoadModule example_module modules/mod_example.so(86th line)(Use sublime Text/vim).
Use default port numbers 8888 for Apache and 8889 for Mysql.
Exactly the same problem I have. Going back to an older 3.0.x solves the problem. Just replace the htdocs and db folder with the ones before the update an it will run again.
Peter
I've had this problem when upgrading from 6.6 to 6.7. Seems that sometimes the Apache and MySQL servers keep on running during the upgrade and there is a problem binding to the port. What worked for me was this:
Completely quit MAMP.
Kill all Apache and MySQL processes using the pkill command:
pkill -f httpd && pkill -f mysql
Run MAMP again and set ports to 80/3306

MAMP 2.0.3 - Apache not restarting at all

I have been trying to install IonCube for the past 2 days on my localhost, and it just won't show up. Today I tried changing the PHP versions to force some sort of hard refresh, and MAMP is not changing versions.
By the looks of this, in my opinion, Apache is not restarting at all, how can I force it to stop with a Terminal command or something?
Thanks in advance.
The short and sweet is to restart your machine entirely, fine for if you're just a local developer.