最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

theme development - Live to Local on MAMP, not working, outputting functions.php code

programmeradmin2浏览0评论

This is an older custom theme. On the live server, I updated to the latest version of WP, updated all plug-ins including ACF. Downloaded all files, DB, and renamed to local URL. I've done this many many times with various builds and have never had an issue.

Running MAMP, the browser is outputting PHP code from the functions.php file. Not the header or any CSS, I see HTML is loading after this. Also can't get to /wp-admin, same result.

PHP running on live server 7.3.11, closest on MAMP is 7.39

Any suggestions on where to look? I was not the original theme developer. This is maddening, as I just need to do a simple homepage redesign and can't develop locally. Not to mention not billing for time troubleshooting. THANKS IN ADVANCE!

This is an older custom theme. On the live server, I updated to the latest version of WP, updated all plug-ins including ACF. Downloaded all files, DB, and renamed to local URL. I've done this many many times with various builds and have never had an issue.

Running MAMP, the browser is outputting PHP code from the functions.php file. Not the header or any CSS, I see HTML is loading after this. Also can't get to /wp-admin, same result.

PHP running on live server 7.3.11, closest on MAMP is 7.39

Any suggestions on where to look? I was not the original theme developer. This is maddening, as I just need to do a simple homepage redesign and can't develop locally. Not to mention not billing for time troubleshooting. THANKS IN ADVANCE!

Share Improve this question asked Aug 7, 2020 at 14:39 rkDevrkDev 11 bronze badge
Add a comment  | 

2 Answers 2

Reset to default 1

If it's outputting some PHP from functions.php but not the whole file then likely you've just got mismatched PHP opening/closing tags - <?php and ?> somewhere, or potentially even mismatched string quotations.

You need to edit that file in a text editor and look carefully around the point it's starting to output PHP for mismatched entities. A good editor that does PHP syntax highlighting will make this much easier.

As it turns out, MAMP is ignoring php openers with just <? not <?php, but if I started changing them, parts of the site render. There are hundreds if not thousands of entries, a huge site with lots of parts. This is the latest syntax and not sure why MAMP won't process it. Googling isn't bringing back many results.

发布评论

评论列表(0)

  1. 暂无评论