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.
Related
Every time macOS is upgraded to a new major version then php, apache or mysql stops working. This happens again with Catalina too. I faced issue in starting apache and mysql. Mysql started to fail as
[ERROR] Fatal error: Please read "Security" section of the manual to find out how to run mysqld as root!
I am posting the solution I performed for starting mysql as well as apache, php on macOS Catalina.
First, I have gone through the steps which I have shared earlier for Mojave.
Apache not working after macOS Mojave update
As I am using PHP 5.6 so I needed libphp5.so to make PHP 5.6 work after macOS upgrade. As before installing catalina, apache/php/mysql was working fine so I have the library already alavailable. I found the .so file using below command and updated the same in "/etc/apache2/httpd.conf"
sudo find / -name libphp5.so
after finding the file, I updated the same with path in /etc/apache2/httpd.conf
LoadModule php5_module
/usr/local/Cellar/php#5.6/5.6.25_1/libexec/apache2/libphp5.so
This makes the PHP 5.6 working but still mysql was failing with below error.
"[ERROR] Fatal error: Please read "Security" section of the manual to find out how to run mysqld as root!"
As it is my development area only so I simply did following:
1. goto the mysql installation bin directory
cd /usr/local/mysql-5.6.25-osx10.8-x86_64/bin
run the mysql with root as user.
sudo ./mysqld --user=root
it started the mysql too.
I recently started a little project in Laravel 5.5. I updated my Homestead box to the latest version.
While writing a test, I came across a segfault if I spelt an assertion method incorrectly, and I created an issue on the github repo which can be found at https://github.com/laravel/framework/issues/20925
The issue has been closed now, as rightfully, it was my mistake (asertPushedOn() instead of assertPushedOn()).
However I've recently come across another segfault, again, it was my error (incorrectly named relationship when trying to eagerload), but the problem is, this never happened prior to 5.5. Now, it seems when I mess something up, I'm randomly getting segfaults. I cant find anything to help debug them in the logs (Laravel logfile or nginx error log.
The only error message I get is Segmentation fault (core dumped) which doesn't tell me anything.
On the issue report, it mentioned xdebug dumps out the error. I had a google for laravel homestead xdebug but could only find resources for phpstorm (I'm a sublime user).
TL;DR:
1) In Laravel 5.5 with an updated homestead box, I'm getting php segfaults now if I mess up somewhere. Is this a change in 5.5 / homestead?
2) How can I enable xdebug (will this actually help debug segfaults)?
3) If xdebug isn't the answer, how can I stop getting, or get more default debug info from segfaults?
As mentioned in the issue I created, I don't know much about segfaults.
If you need any further information, please let me know
EDIT
I managed to enable xdebug with:
sudo phpenmod xdebug
sudo service nginx restart
php -m
But I've been unable to reproduce the segfault (with and without xdebug enabled), which makes segfaults all the more confusing for me.
So while I wasn't able to reproduce the original segfault, another one did occur while xdebug wasn't enabled.
When I enabled xdebug with the following:
sudo phpenmod xdebug
sudo service nginx restart
and reran the script which gave me the segfault, I successfully got the recursion error with the filename and line number to resolve it.
I'm working in framework Phalcon, which uses PHP. I wasn't able to connect my application with Postgresql. I discovered this webpage: Enabling PostgreSQL support in PHP on Mac OS X, which basically says I should download something like "php_pdo_pgsql.so" and following a well voted solution I did:
brew install php56-pdo-pgsql
and then I restarted my apache with:
sudo /usr/sbin/apachectl restart
When I reloaded my web page, which was working perfectly, appears the error:
Service Unavailable
The server is temporarily unable to service your request due to
maintenance downtime or capacity problems. Please try again later.
Looking for the error log of the webpage it seems that after the restart there are not more errors, also no more accesses in the access log. I'm using version 5.6 of PHP. My server is OSX Sierra.
I accept solutions, ideas and new question to solve my problem. Thank you very much.
I solved it!
There were no more errors in apache log. Why? When I installed the PDO of php-postgresql with brew, it automatically installed apache of brew and change the configuration of the server. So, I had 2 "apache" in my server, what screw up everything.
I used this tutorial:
https://getgrav.org/blog/macos-sierra-apache-multiple-php-versions.
In general terms, What I did was uninstallig everything I could and installing apache from brew. Then I made the configuration of the tutorial and finally my webpage is running again.
Thanks.
Please check apache2 logs file, and look for an error. If You will not be able to resolve the problem by yourself, then provide us with error message given in error.log.
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 :)
I know this is my fault. What I did was upgrade my php 5.3 to the latest php5.5. But due to some important reason I need to roll back to my previous php version which is 5.3.10. Upgrading to the latest php5 gave me no sweat but when I roll back it gave me this error:
$ sudo service apache2 start
* Starting web server apache2 apache2: Syntax error on line 210 of /etc/apache2/apache2.conf: Syntax error on line 2 of /etc/apache2/mods-enabled/access_compat.load:
Cannot load /usr/lib/apache2/modules/mod_access_compat.so into server: /usr/lib/apache2/modules/mod_access_compat.so: cannot open shared object file: No such file or directory
Action 'start' failed.
The Apache error log may have more information.
Please help anyone.
Comment line 2 in /etc/apache2/mods-enabled/access_compat.load and all other include problems, 3 for me
I had this problem when downgraded apache from 2.4 to 2.2, so i had to disable the modules there enabled in the 2.4 installation.
a2dismod <module-name>