Ok, after update macOS from High Sierra to Mojave, Apache with PHP stop working properly, so I did everything as is said in this guide - https://getgrav.org/blog/macos-mojave-apache-multiple-php-versions
but after that, still apache not working properly, sometimes working, sometimes not, and its says in browsers ERR_CONNECTION_REFUSED or other errors like 404 or 500.
In apache log is:
[Tue Oct 02 15:02:23.209423 2018] [mpm_prefork:notice] [pid 14579] AH00173: SIGHUP received. Attempting to restart
[Tue Oct 02 15:02:23.255957 2018] [mpm_prefork:notice] [pid 14579] AH00163: Apache/2.4.35 (Unix) PHP/7.2.10 configured -- resuming normal operations
[Tue Oct 02 15:02:23.256008 2018] [core:notice] [pid 14579] AH00094: Command line: '/usr/local/opt/httpd/bin/httpd'
[Tue Oct 02 15:14:37.626645 2018] [mpm_prefork:notice] [pid 14579] AH00173: SIGHUP received. Attempting to restart
[Tue Oct 02 15:14:37.674603 2018] [mpm_prefork:notice] [pid 14579] AH00163: Apache/2.4.35 (Unix) PHP/7.2.10 configured -- resuming normal operations
[Tue Oct 02 15:14:37.674672 2018] [core:notice] [pid 14579] AH00094: Command line: '/usr/local/opt/httpd/bin/httpd'
[Tue Oct 02 15:28:40.715060 2018] [mpm_prefork:notice] [pid 14579] AH00173: SIGHUP received. Attempting to restart
[Tue Oct 02 15:28:40.752117 2018] [ssl:warn] [pid 14579] AH01909: www.example.com:8443:0 server certificate does NOT include an ID which matches the server name
[Tue Oct 02 15:28:40.766009 2018] [mpm_prefork:notice] [pid 14579] AH00163: Apache/2.4.35 (Unix) OpenSSL/1.0.2p PHP/7.2.10 configured -- resuming normal operations
[Tue Oct 02 15:28:40.766052 2018] [core:notice] [pid 14579] AH00094: Command line: '/usr/local/opt/httpd/bin/httpd'
I have faced similar issue with PHP 5.6 as it was running fine before Mojave upgrade. I did the following to resolve the issue successfully:
Run the command below
sudo nano /etc/apache2/httpd.conf
make sure the below modules are uncommented:
LoadModule authz_core_module libexec/apache2/mod_authz_core.so
LoadModule authz_host_module libexec/apache2/mod_authz_host.so
LoadModule userdir_module libexec/apache2/mod_userdir.so
LoadModule include_module libexec/apache2/mod_include.so
LoadModule rewrite_module libexec/apache2/mod_rewrite.so
I have added the missing one in httpd.conf
Check the right php module for you (PHP 5.6 ot 7.x) and load the required module too by adding the line or commenting/uncommenting the lines
LoadModule php5_module libexec/apache2/libphp5.so
OR
LoadModule php7_module libexec/apache2/libphp7.so
Comment the one not needed by adding "#" to start of line
Run below commands for apapche restart and test
a. sudo apachectl restart
b. apachectl configtest
Check for any errors there
For PHP 5.6:
In case you were having the php 5 with brew already in system before upgarde and the above changes gives error as below
"httpd: Syntax error on line 180 of /private/etc/apache2/httpd.conf: Cannot load libexec/apache2/libphp5.so into server: dlopen(/usr/libexec/apache2/libphp5.so, 10): image not found"
Then search for libphp5.so in the system and if found copy it to "/usr/libexec/apache2/"
In my case command was
sudo cp ./local/Cellar/php#5.6/5.6.25_1/libexec/apache2/libphp5.so /usr/libexec/apache2/
This all made things working in my system
Further to adang's reply i also had to uncomment this line:
Include /private/etc/apache2/extra/httpd-userdir.conf
in order for it to know what user directories were available.
Within /private/etc/apache2/extra/httpd-userdir.conf
I had to uncomment this line:
Include /private/etc/apache2/users/*.conf
then:
sudo apachectl restart
I had the same issue after installing the Mac OS Mojave.
I have done the following steps and it worked with me:
brew update
then:
brew upgrade
I have edited /etc/apache2/httpd.conf by uncommenting the following line:
LoadModule php7_module libexec/apache2/libphp7.so
Open the terminal and restart the apache server:
sudo apachectl restart
you might find the post on this link helpful
I followed the instructions in the above answers and still got a 403 Forbidden when trying to access my /Users/myuser/Sites/ folder. To fix this I had to change the user in /etc/apache2/httpd.conf from _www to my own user.
To do this edit your httpd.conf file using your favorite editor /etc/apache2/httpd.conf. Look for:
User _www
replace with your user:
User myuser
then restart apache:
sudo apachectl restart
because the topic is the httpd.conf messed up after Mojave upgrade I got also this error during sudo apachectl configtest
Could not reliably determine the server's fully qualified domain name, using XXX. Set the 'ServerName' directive globally to suppress this message
I found out the #ServerName localhost:80 in the httpd.conf was comented out, uncommenting resolved my issue.
Related
I need Xampp for Windows 32 bit with a php version of at least 7.4. I can only find a php version 7.3 which is too low. So I need to upgrade it.
I downloaded vc15 x86 threadsafe/zip from, php.net. I extracted it. Renamed xampp\php to xammp\php-old. I then copied php.ini-development to php.ini and made all the changes to php.ini as per this tutorial https://www.youtube.com/watch?v=ir_ZewB_PHY
I restarted Xampp but its giving the error message: Error: Apache shut down unexpectedly. This may be due to a blocked port, missing dependencies..."
I dont have Skype/ Team Viewer or Anydesk open.
I changed the port settings of the httpd.conf File to listen to port 8080 instead of port 80. In http-ssl.conf I changed listen 443 to listen 4433.
I restarted Xampp but I'm still having errors. The Apache (error.log) reflects there errors.
[Wed Aug 24 12:39:53.747228 2022] [ssl:warn] [pid 4220:tid 460] AH01909: www.example.com:443:0 server certificate does NOT include an ID which matches the server name
[Wed Aug 24 12:39:53.922456 2022] [core:warn] [pid 4220:tid 460] AH00098: pid file C:/xampp/apache/logs/httpd.pid overwritten -- Unclean shutdown of previous Apache run?
[Wed Aug 24 12:39:53.922456 2022] [ssl:warn] [pid 4220:tid 460] AH01909: www.example.com:443:0 server certificate does NOT include an ID which matches the server name
PHP Warning: 'vcruntime140.dll' 14.0 is not compatible with this PHP build linked with 14.16 in Unknown on line 0
[Wed Aug 24 12:39:53.938089 2022] [:emerg] [pid 4220:tid 460] AH00020: Configuration Failed, exiting
I really dont know how to solve this and support will be greatly appreciated. My os is Windows 10 32 bit. I was told my laptop cant be upgraded to 64 bit.
Many thanks in advance.
Edit 24 August 2022 !7h30 Johannesburg
I checked PHP module lines in my httpd-xamp.conf is correct.
LoadFile "C:/xampp/php/php7ts.dll"
LoadFile "C:/xampp/php/libpq.dll"
`LoadModule php7_module "C:/xampp/php/php7apache2_4.dll"
I ran httpd.exe -t from the windows command prompt it it shows that the syntax is OK.
I ran httpd.exe -v and it shows Server version: Apache/2.4.38 (Win32)
I have what used to be a typical Apache 2.4 installation on an Ubuntu 16.04 LTS.
There is a /etc/apache2/sites-available/ directory where all configuration files are stored and from where one can enable sites.
Here is one of them titled localhost.conf
<VirtualHost *:80>
ServerName 127.0.0.1
ServerAlias sites.dev
DocumentRoot /var/www/sites/
<Directory />
Options FollowSymLinks
AllowOverride None
</Directory>
<Directory /var/www/sites>
Options Indexes FollowSymLinks MultiViews
AllowOverride None
Require all granted
</Directory>
</VirtualHost>
I have enabled this site. When I navigate to sites.dev, I see the contents of that directory being listed since it does not have an index.php file. So far, so good.
I then add a info.php file to the same directory which looks like this
<?php
// Show all information, defaults to INFO_ALL
phpinfo();
?>
Now, when I navigate to sites.dev/info.php, I see a blank page.
Furthermore, when I look at the /var/log/apache2/error.log, I see entries like these
[Tue Feb 05 22:21:44.281005 2019] [mpm_prefork:notice] [pid 2149] AH00163: Apache/2.4.18 (Ubuntu) configured -- resuming normal operat$
[Tue Feb 05 22:21:44.281059 2019] [core:notice] [pid 2149] AH00094: Command line: '/usr/sbin/apache2'
[Tue Feb 05 22:24:55.006296 2019] [mpm_prefork:notice] [pid 2149] AH00169: caught SIGTERM, shutting down
[Tue Feb 05 22:24:56.064108 2019] [mpm_prefork:notice] [pid 2320] AH00163: Apache/2.4.18 (Ubuntu) configured -- resuming normal operat$
[Tue Feb 05 22:24:56.064149 2019] [core:notice] [pid 2320] AH00094: Command line: '/usr/sbin/apache2'
Could someone tell me what is happening? How can I fix this localhost and the local development environment?
I solved it using the following sequence of steps:
Install PHP 7 (even though it was already installed)
apt-get install php
apt-get install php-pear php7.0-dev php7.0-zip php7.0-curl php7.0-gd php7.0-mysql php7.0-mcrypt php7.0-xml libapache2-mod-php7.0
sudo a2enmod proxy_fcgi setenvif
sudo a2enconf php7.0-fpm
sudo service apache2 reload
I am having a strange error (system is Ubuntu 16.04):
[Mon Sep 04 13:07:17.219992 2017] [mpm_prefork:notice] [pid 27798] AH00169: caught SIGTERM, shutting down
[Mon Sep 04 13:07:17.302181 2017] [so:warn] [pid 27874] AH01574: module php7_module is already loaded, skipping
PHP Warning: PHP Startup: Unable to load dynamic library '/usr/lib/php/20151012/php_curl.dll' - /usr/lib/php/20151012/php_curl.dll: cannot open shared object file: No such file or directory in Unknown on line 0
[Mon Sep 04 13:07:17.322006 2017] [mpm_prefork:notice] [pid 27875] AH00163: Apache/2.4.18 (Ubuntu) configured -- resuming normal operations
[Mon Sep 04 13:07:17.322026 2017] [core:notice] [pid 27875] AH00094: Command line: '/usr/sbin/apache2'
PHP version is 7.1.19. I installed curl (apt-get install php7.1-curl), in the php.ini I added extension=curl.co (and commented out extension=php_curl.dll), restarted the apache service, and the error is still there (I tried commenting out extension=curl.co but the error is still there).
This is an error I am getting on the page (Laravel setup):
Call to undefined function App\curl_init()
Everything is installed and config files are as required and I don't know what could be wrong here.
The /etc/php/7.1/mods-available/curl.ini file content should be:
extension=curl.so
Please notice the extension is .so, and not .co.
Then you can enable the module in your PHP by running:
$ sudo phpenmod curl
Finally, you may need to restart your Apache:
$ sudo systemctl restart apache2
So I'm trying to get my LAMP stack to work in my Macbook. I've apache setup but PHP is not working. I've installed php55 with Brew and loaded the module in my httpd.conf file like this:
LoadModule php5_module /usr/local/opt/php55/libexec/apache2/libphp5.so
I've checked if the libphp5.so was at the location the module is pointing and it was there.
If I check my apache error.log I get the following message:
[Sat Apr 23 21:36:59.307093 2016] [ssl:warn] [pid 7231] AH01873: Init: Session Cache is not configured [hint: SSLSessionCache]
[Sat Apr 23 21:36:59.358254 2016] [auth_digest:notice] [pid 7231] AH01757: generating secret for digest authentication ...
[Sat Apr 23 21:36:59.360623 2016] [mpm_prefork:notice] [pid 7231] AH00163: Apache/2.4.18 (Unix) LibreSSL/2.2.6 PHP/5.5.34 configured -- resuming normal operations
[Sat Apr 23 21:36:59.360661 2016] [core:notice] [pid 7231] AH00094: Command line: '/usr/sbin/httpd -D FOREGROUND'
I'm missing something but I'm not quite sure what at this point.
Did you also update your Apache config to recognize .php extensions?
AddType application/x-httpd-php .php
or
<FilesMatch \.php$>
SetHandler application/x-httpd-php
</FilesMatch>
add the following line to your httpd.conf:
AddHandler application/x-httpd-php .php
after apache restart everything should work
I have the following line uncommented in httpd.conf:
LoadModule php5_module libexec/apache2/libphp5.so
When I go to any php page, the file downloads instead of displaying in the browser. I verified that if I go to a html page, the page displays correctly so it for sure has to do with PHP.
Weird thing is that this was working fine ever since I started using this Mac computer but all of a sudden stopped working. The only thing that I can think of that I did is update Slack but that doesn't seem like it would have anything to do with this.
Also another weird thing is that my command line tool (drush) which uses the same php does work.
I can't think of what it can be.
I tried to use Homebrew to install another version of php but the problem remains.
This is in the apache error log when I run the apachectl restart command:
[Tue Jan 19 16:56:12.370590 2016] [mpm_prefork:notice] [pid 994] AH00169: caught SIGTERM, shutting down
[Tue Jan 19 16:56:12.600054 2016] [mpm_prefork:notice] [pid 1005] AH00163: Apache/2.4.16 (Unix) PHP/5.5.30 configured -- resuming normal operations
[Tue Jan 19 16:56:12.600123 2016] [core:notice] [pid 1005] AH00094: Command line: '/usr/sbin/httpd -D FOREGROUND'
I am not seeing any errors in my php error log or anything in the apache error log (otherwise what I specified above after running the command).
Please make sure that correct AddType for php is application/x-httpd-php
AddType application/x-httpd-php .php
AddType application/x-httpd-php-source .phps
Also make sure your php module is loaded
LoadModule php5_module modules/mod_php55.so