Silex setup fails with MAMP because mod_access.so is not found? - php

I have downloaded Silex and I am trying to get it running with MAMP. However, when I run Silex (and only when I run Silex), Apache won't start. In the console, I see:
httpd: Syntax error on line 238 of /Applications/MAMP/conf/apache/httpd.conf: Cannot load /Applications/MAMP/Library/modules/mod_access.so into server: dlopen(/Applications/MAMP/Library/modules/mod_access.so, 10): image not found
logout
Googling the error leads to info that suggests this is a known bug, but I can't find what to actually do about it.
Silex temporarily changes my httpd.conf from this to this while it's running. After it changes back, upon quitting Silex, Apache starts again.
Apache is version 2.2.22.

Related

Webserver status set to down after installing PHP on the webserver

After I install php 8.0 on my webserver running apache 2.4.53 on ubuntu 20.04, my haproxy config on a pfsense router says the webserver is down. Even though apache is running fine.
I know its the main cause because after I uninstall php 8.0 the webserver is up and accessible according to haproxy.
The problem is, that I can't load content without having php installed on the webserver, but if I have it installed, the webserver isn't accessible from the designated ip.
I have tried reading the haproxy error log, but I can't find it. Also tried to reinstall the haproxy config but this also didn't work. In haproxy status overiew it also gives the error: Layer 7 wrong status: internal server error, googling this didn't give much results.

SQLAnywhere PHP extension errors on Apache restart

I have the SQLAnywhere PHP extension installed and it's working fine, right up until Apache restarts.
After Apache has restarted, any attempt to access any website on the server generates the following error in the Apache error log and throws a 500 internal server error on the page:
AH01215: PHP Warning: request_startup() for sqlanywhere module failed in Unknown on line 0: /usr/local/cpanel/cgi-sys/ea-php56
To resolve it, I can explicitly stop and start Apache, but restarting Apache (apachectl restart) doesn't.
This is generally fine until an automated process (such as a cPanel update) causes Apache to restart.
The SQLAnywhere PHP extension was configured as follows:
Install the SQLAnywhere client
Download the PHP extension to the extensions directory
Add LD_LIBRARY_PATH=[sqlanywhere/lib64] to /etc/environment
Log out and back in for the LD_LIBRARY_PATH to take effect
Add the extension to the php.ini (or sqlanywhere.ini in php.d folder)
Stop then start Apache
My current thinking for a workaround is to modify the cPanel update script to perform an Apache restart by explicitly doing a stop then a start as this would cover the immediate issue, but I'm hoping that somebody might know of an actual fix for this to avoid any other automated restarts causing problems.
The stack I'm running is:
CentOS Linux release 7.3.1611 (Core)
cPanel 60.0 (build 28)
Apache/2.4.23 (cPanel)
PHP 5.6 (using cPanel's MultiPHP and EasyApache4)
SQLAnywhere12 Client
Thanks in advance for any suggestions!

How to reconfigure apache httpd.conf file for local LAMP environment?

I was attempting to set-up my local environment for LAMP on my desktop with Guy Nathan's Installing LAMP stack on OSX Mavericks with Homebrew updated guide. Since I'm experienced with RoR, I proceeded with homebrews but along the way, evidently, I misconfigured the /usr/local/etc/apache2/2.2/httpd.conf file because whenever I try to start the apache server with sudo apachectl start or test with sudo apachectl configtest, the following error is invariably returned:
httpd: Syntax error on line 482 of /usr/local/etc/apache2/2.2/httpd.conf: Could not open configuration file /Sites/httpd-vhosts.conf: No such file or directory
Due to the length of the 'http.conf' file, I've created a gist of my 'httpd.conf file' for review.
At this point, I would just like to reset my 'httpd.conf' file, or whatever is necessary so I can properly configure my local environment for LAMP. I've tried other solutions involving a reversion of /private/etc/apache2/httpd.conf.pre-update but was unable to effect. Thank you.
It is failing to start because the httpd.conf file is specifying an include of /Sites/httpd-vhosts.conf which doesn't exist.
Either comment out line 482 by putting a # at the beginning of the line, or create an empty /Sites/httpd-vhosts.conf file so it can be included. If its empty it won't have any effect.
Here are some examples of what would typically go in that file.

I installed symfony 3, ran the server and got a connection refused when I ran the webserver

I auto-generated a Symfony 3 application with the CLI they provide and I put it inside my www/html folder, which my apache2 server serves its files from:
Then I tried to do:
$ php bin/console server:start -vvv
$ sudo php bin/console server:start -vvv
$ php bin/console server:start 127.0.0.1:2040
but I keep getting the following error:
[2016-03-18 00:06:14] php.DEBUG: fsockopen(): unable to connect to 127.0.0.1:8000 (Connection refused) {"type":2,"file":"/var/www/html/sample_symfony_blog/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Command/ServerCommand.php","line":59,"level":28928}
I can't find any concrete answer on what this could be, other than it could be that the port is busy, which is why I tried with port 2040 as well.
Symfony official's documentation talks about some user rights running the webserver and that the PHP CLI should have the same permissions or something? I'm not that used to configure Apache/Ubuntu so I don't know what to do to test it out in that regard. Any hints?
At the risk of resurrecting a really old question, I'd like to add a note from recent experience. I had a working Symfony 3 installation using PHP 5.6 that stopped working when I upgraded to PHP 7.1. Trying to start the built-in server gave me the same connection refused error, which led me here.
Ultimately, I solved the problem by running php bin/symfony_requirements. The output told me that I had xdebug.scream turned on in my php.ini and it had to be turned off. Fixing that made the problem go away.
I hope this helps someone.
Okay, so i realized putting a error early in my /etc/php5/cli/php.ini file, made it work, obviously because my php.ini file ran a configuration that made it not work, i did not find out which file option that caused it to happen. The reason i even tried to fix this problem was because i couldn't get it to work by accessing it via my apache2 webserver on localhost:80/my_project, but instead had to access localhost:80/my_project/web which works just fine, so im doing that instead of running my own builtin php server - because thats the way i have to run it in production anyway so. Thanks to anyone who sat down and tried to figure it out :)

Homebrew Yosemite Apache issue

I installed a Homebrew Apache setup as explained here.
For me, it doesn't work at the moment.
When running httpd -DFOREGROUND, I'm getting the next error:
httpd: Syntax error on line 117 of /usr/local/etc/apache2/2.2/httpd.conf: Cannot load /usr/local/Cellar/php55/5.5.27_2/libexec/apache2/libphp5.so into server: dlopen(/usr/local/Cellar/php55/5.5.27_2/libexec/apache2/libphp5.so, 10): Symbol not found: _ap_unixd_config\n Referenced from: /usr/local/Cellar/php55/5.5.27_2/libexec/apache2/libphp5.so\n Expected in: /usr/local/bin/httpd\n in /usr/local/Cellar/php55/5.5.27_2/libexec/apache2/libphp5.so.
The file (/usr/local/Cellar/php55/5.5.27_2/libexec/apache2/libphp5.so) does exist though.
Running dnsmasq --keep-in-foreground then, it fails with dnsmasq: failed to create listening socket for 127.0.0.1: Address already in use.
All error logs in troubleshooting are empty.
Important to know is, that I installed another setup earlier, before upgrading to 10.10 that did work for a while, stopped working suddenly. After that, I decided to upgrade my OS and removed everything as explained in the Troubleshooting section. I restarted from the beginning.
Thanks!
Try to brew reinstall php55 --homebrew-apxs.
As mentioned here, this should solve this problem.

Categories