WordPress site not loading

PHP Tools [?] extends Visual Studio with set of advanced features to work more efficiently with PHP code.

WordPress site not loading

Postby strattonn » March 6th, 2015, 4:48 am

Hi,

I just purchased PHP Tools and am trying to get a local WordPress site running. I created a PHP website, added every file for the site into the project and ran it. I can debug the site and watch variables but nothing shows in the browser.

I can set a breakpoint in the top of my functions.php and see that it hits that.

Sometimes I get the error "Call to undefined function add_action()" but add_action is part of the core. Sometimes is_robots() fails but it's also in the core and F12 will take me to the implementation of it.

If I let it run I just get "This web page is not available".

Do you have any ideas why I can't see the home page?

The URL is http://localhost/?XDEBUG_SESSION_START=C619923D but all the image links in WP point to http://ds04.projectstatus.co.uk/backdrops (my hosts file points the domain to 127.0.0.1). How will that work?

Maybe this is another thread but I have ampps on my machine, I specified its php directory and corrected the issues suggested by PHP Tools but every time I run it complains PHP isn't setup, so I'm using the internal web server and AMPPS MySQL.
strattonn
 
Posts: 2
Joined: March 6th, 2015, 4:14 am

Re: WordPress site not loading

Postby Miloslav Beno » March 6th, 2015, 3:49 pm

Hello,

That just seems as issue with wordpress installation. During WP install user inserts url where wp will run, anything else won't work (there are workarounds but they all bring some inherited issues with it)

This url has to be setup also in project properties in Use Custom server, Server URL property.

About "Call to undefined function add_action()" is just php error saying that functions is not defined in the current context. That might happen e.g when file is requested by user not by wp. There are plenty of threads dedicated to this on wp forum, e.g https://wordpress.org/support/topic/call-to-undefined-function-add_action-2

Hopefully that will help.

Thanks,
Miloslav Beno │ DEVSENSE s.r.o. │ @miloslavbenomiloslav@devsense.com
User avatar
Miloslav Beno
 
Posts: 1252
Joined: January 7th, 2012, 8:36 pm


Return to PHP Tools

Who is online

Users browsing this forum: No registered users and 73 guests

cron

User Control Panel

Login

Who is online

In total there are 73 users online :: 0 registered, 0 hidden and 73 guests (based on users active over the past 5 minutes)
Most users ever online was 330 on April 19th, 2024, 1:35 am

Users browsing this forum: No registered users and 73 guests