I've downloaded php5.6 from here https://www.mamp.info/en/downloads/ and added it to php folder. After that I can't run Apache server. I removed that folder, but Apache still doesn't work. Files in /Local/logs/ are empty.
Mac OS Mavericks.
Same problem here. A (temporary) solution is to start apache from the terminal:
sudo /Applications/MAMP/Library/bin/apachectl start
MAMP detects it as its status light becomes green! But I cannot explain why MAMP doesn't command apache anymore, with nothing logged.
Tried to modify file /bin/startApache.sh, adding a sudo before start command, without success.
Related
I downloaded the installer version of Xampp version 8.1.6-0 for Mac and went to the manager-osx widget to start the Apache and MySQL servers but neither would start.
I then tried using the command sudo apachectl start and then created an index.php file and put it in htdocs, and then tried to open it using http://localhost/index.php as well as http://localhost:8080/index.php and both times it said the server could not be reached.
I've actually downloaded Xamp in the past and was able to reach the server but wasn't able to get php scripts to run, but now for some reason I can't even get the server to run.
I made sure to download the installer and not the virtual machine version. I'm running Monterey version 12.4.
I tried the solutions here but they didn't seem to work. I checked my activity monitor and nothing is running on port 80.
I also installed MAMP from here and tried to start Apache but it displayed the error:
"Apache couldn't be started. Please check your MAMP installation and
configuration."
Any help would be appreciated as I just want to run PHP.
I've recentlly got a problem with my local virtual hosts after installing php 5.6 next to php 7.0. I'm using Ubuntu 16.04 with Apache, MySQL etc. configured for Laravel projects and everything was working perfectly fine with php 7.0 until I had to work with another project. This non-laravel project required php 5.6 to work, so I installed it next to php 7.0 together with some modules for phpmyadmin (as it didn't work after I switched server to php 5.6). So what I did after installing php 5.6 was:
sudo a2dismod php7.0
sudo a2enmod php5.6
sudo service apache2 restart
Added a new host for my php 5.6 project in /etc/hosts as 127.0.0.1 www.myhost.local.
Added a new config in sites-available, enabled it, restarted the server.
Installed few required by phpmyadmin modules to configure database for the new project.
Worked with my php 5.6 project.
When I wanted to switch back to my Laravel projects I made:
sudo a2dismod php5.6
sudo a2enmod php7.0
sudo service apache2 restart
And none of the laravel hosts worked. The error I get from Google Chrome is:
This site can’t be reached
www.myhost.local’s server IP address could not be found.
ERR_NAME_NOT_RESOLVED
And I DIDN'T CHANGE configs of Laravel projects! I didn't edit neither sites-availavle configs, nor etc/hotst except for adding the line with my php 5.6 project. I've tryed:
Checking /etc/apache2/mods-enabled where are php7.0.load and php7.0.conf enabled.
Checking service apache2 status and got Apache active (running).
Checking http://localhost/ and got the default apache page.
Checking http://localhost/php.info which showed me that server is running with php 7.0
Deleting php 5.6 host from etc/hosts and disabling same config in sites-available.
Adding < VirtualHost 127.0.0.1:80 > instead of < VirtualHost *:80 > in the beginning of my Laravel host config. Which made some inner pages work if loaded without www and home page still didn't and www was added to url every time I tryed to load it. However some inner pages began later to generate www too and nothing helped :(
Checking apache logs and got warnings only.
Some other minor things I can't remember now...
Can anyone help please? Or is it easier to reinstall php completely?
Thanks everyone! That was browser cache (although I've checked other browsers I never opened my projects in). So it finally worked in incognito window and after I cleared Chrome's and FF's cache.
Hi I am very new to both apache and mac.
I had set up apache through Homebrew and as far as I understand so far,
apache from mac runs on OS level, but apache through Homebrew runs on user level. I think that is why mac apache stays in /etc level directory while Homebrew apache stays in /user/local/etc level.
However, I found out that both httpd.conf files differ from each other. Especially I am experiencing a problem that php doesn't render in a virtual host. I tried to fix the problem, but it seems like every solutions in the internet talks about httpd.conf for mac apache.
I am quite confused of what I am doing right now. It will be great if anyone of you guys can explain me how these apaches work different. Thanks!
Default apache path would be:
/etc/apache2/httpd.conf
homebrew apache path
/usr/local/etc/httpd/httpd.conf
You can check how many apaches are running in your system:
which -a apachectl
Default apache:
/usr/sbin/apachectl
Homebrew:
/usr/local/bin/apachectl
The command below for default apache
sudo apachectl restart
You may use this for the homebrew apache
sudo /usr/local/bin/apachectl restart
Apache won't start on Mac with XAMPP. I tried updating PHP from 5.5.6 to PHP 5.6.8, and since that update XAMPP wouldn't start Apache. I tried completely re-installing XAMPP, but same issue.
Help would be appreciated, I'm more than happy to post any information that is necessary, not sure where to start. I've done a lot of looking around and haven't been able to find anything that points me in the right direction - I checked the Apache error_logs and there aren't any.
Try this -
Solution#1
This solution worked perfectly fine for me..
1) Close XAMPP control
2) Open Activity Monitor(Launchpad->Other->Activity Monitor)
3) Select filter for All processes (default is My processes)
4) In fulltext search type: httpd
5) Kill all httpd items
6) Relaunch XAMPP control and launch apache again
OR, Solution#2
sudo apachectl stop
This command kills Apache server that was pre-installed on MAC OS X.
OR, Solution#3
sudo launchctl unload -w /System/Library/LaunchDaemons/org.apache.httpd.plist
This will disable OSX's built-in Apache server and allows XAMPP to start on 80.
Now once Apache starts successfully modify the .htaccess file
Apache needs to be configured to recognize index.php as an index file. While adding 'DirectoryIndex index.php' to a .htaccess file may work,
NOTE:
In general, you should never use .htaccess files
This is quoted from http://httpd.apache.org/docs/1.3/howto/htaccess.html
Although this refers to an older version of apache, I believe the principle still applies.
Adding the following to your httpd.conf (if you have access to it) is considered better form, causes less server overhead and has the exact same effect:
<Directory /myapp>
DirectoryIndex index.php
</Directory>
I've updated PHP to 8.0 in xampp by renaming old PHP folder to PHP_7.4
and new pasted new php8 folder as php folder, it gave me same error,
SOLUTION
Step1: backup old php folder,
Step2: Paste php8 files in to old PHP folder and overwrite existing files,
Done: Restart Apache it should start
I have a project that it is deploy and running on Debian (apache 2.2.9, php5.2, mysql 5.0)
Now i trying to run it in ubuntu 11.10(apache 2.2 php 5.3 mysql 5.1) but only the homepage is working.
If i click on any of the links I get the Not Found page:
Not Found
The requested URL /patients was not found on this server.
Does anybody have an idea why it is doing this?
I basically check everything, I can't figure out why.
I have a feeling it has to do with cakephp.
You need to enable mod_rewrite in Apache.
Run this command in terminal: sudo a2enmod rewrite, another I had to do for a fresh install was sudo a2enmod headers. Afterwards, you'll need to restart Apache, the terminal will tell you what command you have to run to do that.