Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Localhost shows site's folder structure and filenames. Also shows php code on web page's content#862

Discussion options

I followed the instructions from this page and successful able to switching multiple PHP versions.
Command "php -v" shows correct version of PHP I switched.
However all versions of PHP show on browser with site's folder structure with web page filenames. Navigate to index.php shows PHP code in web page's content.

How to fix this please?

You must be logged in to vote

You need to install a web server. I would recommend installing apache. Follow the Apache Installation section inthis guide.

Replies: 1 comment 2 replies

Comment options

You need to install a web server. I would recommend installing apache. Follow the Apache Installation section inthis guide.

You must be logged in to vote
2 replies
@chinthyelim
Comment options

Yes, I already have installed the Apache on my Mac Book Pro. It is working when I run command "brew services start httpd". I can see that the DocumentRoot I changed in https.conf loads the site from this specific path. However it shows the PHP code in the localhost's web page's content.

@chinthyelim
Comment options

Thank you@shivammathur for theguide, I missed below section. It is working as charm now!

`
DirectoryIndex index.php index.html

<FilesMatch .php$>
SetHandler application/x-httpd-php
`

Answer selected bychinthyelim
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Labels
None yet
2 participants
@chinthyelim@shivammathur

[8]ページ先頭

©2009-2025 Movatter.jp