Jump to content

Error: Call to a member function numChildren() on a non-object


anyway
 Share

Recommended Posts

PHP 5.4.16

MySQL 5.6.19

ProcessWire 2.5.3

Hi everybody!

I'm new at ProcessWire, reading a lot here and did my first steps locally on a MAMP environment. I'm coming from Wordpress and PW is really great, but I'm still learning and my PHP knowledge is very little, too.

Now my problem: everything is working fine locally, but not since I loaded the package up on a live environment (did it with ProcessExportProfile). The Frontend is not shown and I'm getting this error at the frontend:

Error: Call to a member function numChildren() on a non-object (line 754 of /*/*/*/project-folder/wire/core/Pages.php) 

and this one inside the site/assets/logs/errors.txt

member function numChildren() on a non-object (line 754 of /*/*/*/project-folder/wire/core/Pages.php)

Also the login time of the backend is very short on the live server. Just 60 seconds.

Many thanks for your help in advance and... greetings from Germany :-)

Link to comment
Share on other sites

Hi!

It seems to me that the page you are calling with the method numChildren() from your template may not exist. But, I guess, I cannot point out where exactly is the problem, until I see the code :) My procedure of moving to the live server is a bit different. On the live server I install a clean PW, then I move my templates there and create a backup of sql using ProcessDatabaseBackups to import it back on my live server. Yeah, more steps to do, but works for me :)

Greeting from Lithuania.

  • Like 3
Link to comment
Share on other sites

Can you still login normally in the admin ?

Did you locally develop the site in a subdirectory and moved the site to the webroot ?
Did you check if your hosting php.ini settings match the ones on your local mamp ?

Write permissions on your online folders (e.g. /site/assets /site/config.php ) ?

You might also have to delete the session and cache files in the /site/assets directory.

Check the database credentials in the file site/config.php on the server,

are they adjusted to the online environment databasename, login etc ?

When everything worked locally check the upload integrity to your host.
During zip, ftp upload and unzip sometimes not everything makes it to
the host. Call to a member function error is usually because some data
is missing e.g. somewhere a function returns nothing where something
is expected or some database object has ended up null.
Check if you closed a connection too early or somehow got overrided.

Alternative migrate:

Sometimes errors don't show up when zipping up your complete site from local to host.

In that case migrate your local site to your host as follows:

1. backup your local /site folder

2. backup your local database

3. erase all files, folders in the root and tables in your existing database on the host, if any

4. install a fresh processwire on the host

5. replace the /site folder with your local /site folder backup

6. erase all tables in your database on the host

7. import your local database backup

If any errors they should manifest during this process to give you further debugging information.

If no errors popped up during this process your site should work now.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...