@Chris62
Ich habe es mal nachvollzogen und so geht es: ( iMac Sierra 10.12.6 )
Zuerst legst du dir einen Ordner in deinem Benutzerverzeichnis (Finder: Tastenkombination
⇧ + ⌘ + H) an: Ordnername > Sites
In diesen "Sites"- Ordner legst du eine Text-Datei namens "index.php" > Inhalt:
<?php phpinfo(); ?>
Terminal:
01. Apache starten
sudo apachectl start
Wenn du jetzt im Browser
http://localhost
eingibst, siehst du "It works!" vom System-Apachen
Die config des System-Apachen via Terminal einstellen:
02. config öffnen
/etc/apache2/httpd.conf
Mit crtl+w sucht man nach: php
#LoadModule php7_module libexec/apache2/libphp7.so
…ändern in: (Raute # vorne weg)
LoadModule php7_module libexec/apache2/libphp7.so
Mit crtl+w sucht man nach: rewrite_module
#LoadModule rewrite_module libexec/apache2/mod_rewrite.so
…ändern in: (Raute # vorne weg)
LoadModule rewrite_module libexec/apache2/mod_rewrite.so
Mit crtl+w sucht man nach: DocumentRoot
DocumentRoot "/Library/WebServer/Documents"
<Directory "/Library/WebServer/Documents">
…ändern in:
DocumentRoot "/Users/Christoph/Sites"
<Directory "/Users/Christoph/Sites">
Dann kannst du noch den Apache Benutzer auf dich setzen**:
Mit crtl+w sucht man nach: User/Group
Code:
# User/Group: The name (or #number) of the user/group to run httpd as.
# It is usually good practice to create a dedicated user and group for
# running httpd, as with most system services.
#
User _www
Group _www
…ändern in:
Code:
# User/Group: The name (or #number) of the user/group to run httpd as.
# It is usually good practice to create a dedicated user and group for
# running httpd, as with most system services.
#
User Christoph
Group staff
^**
falls du dann später erneut die httpd.conf bearbeiten willst, aber "Permission denied" sein sollte, dann:
sudo nano -w +114 /etc/apache2/httpd.conf
…und mit deinem Passwort bestätigen.
htaccess aktivieren:
Mit crtl+w sucht man nach: htaccess
Code:
# AllowOverride controls what directives may be placed in .htaccess files.
# It can be "All", "None", or any combination of the keywords:
# AllowOverride FileInfo AuthConfig Limit
#
AllowOverride None
…ändern in:
Code:
# AllowOverride controls what directives may be placed in .htaccess files.
# It can be "All", "None", or any combination of the keywords:
# AllowOverride FileInfo AuthConfig Limit
#
AllowOverride All
Speichern der httpd.conf mit > ctrl+o
Editor beenden mit > ctrl+x
Apache neu starten >
sudo apachectl restart
fertig.
Jetzt solltest du im Browser bei:
http://localhost die php Infos sehen.
edit:
Falls du noch Fragen haben solltest – habe weiter noch:
- mysql installiert
- Sequel Pro installiert
- php 7.3 installiert
- eine Datenbank angelegt und eine Wordpress Website local in "Sites" reingeclont
- php.ini aktualisiert (preg_match(): JIT compilation failed: no more memory > Find pcre.jit and change ;pcre.jit=1 to pcre.jit=0)
Läuft jetzt gut.