Jump to content

Help needed for local setup on a MAC


seankobuk
 Share

Recommended Posts

I've never had issues getting things up and running on a pc but we recently switched to MAC at work and our resident Process Wire guy also left the company so I am left to my own devices to work this out. I am able to run other php based projects locally with no trouble so it is probably not a generic php mysql issue. I am mostly a css/html guy and not a PHP guru so I am stuck at this point.


So far I have...

1. Created local database and filled in info on my config.local.php

2. Created hosts and vhosts entries

When I go to my local url I get a bunch of errors which are not seen on the live server version of the site at http://gorges.us. I have write permissions on the assets folder so I'm not sure what to make of these errors.

Fatal error: Call to a member function filter() on a non-object in /Users/seankennedy/Documents/gorges-web/webroot/site/templates/home-page.php on line 13

Warning: fopen(/Users/seankennedy/Documents/gorges-web/webroot/site/assets/logs/errors.txt): failed to open stream: Permission denied in /Users/seankennedy/Documents/gorges-web/webroot/wire/core/FileLog.php on line 63

This error message was shown because site is in debug mode ($config->debug = true; in /site/config.php). Error has been logged.

Warning: Unknown: open(/Users/seankennedy/Documents/gorges-web/webroot/site/assets/sessions/sess_qrch1vdvp6im40f3r4csfi8qg7, O_RDWR) failed: Permission denied (13) in Unknown on line 0

Warning: Unknown: Failed to write session data (files). Please verify that the current setting of session.save_path is correct (/Users/seankennedy/Documents/gorges-web/webroot/site/assets/sessions) in Unknown on line 0

Any help would be greatly appreciated.

Link to comment
Share on other sites

Link to comment
Share on other sites

  • 2 months later...

I looked at these guides but I think my basic set up is fine. I am running many sites using php / mysql without a problem on this machine. The first error seems to be a php issue which is not my forte. I got rid of the last 2 warnings by changing permissions on that folder but the FileLog.php file warning has persisted even though it has all permissions set.  

Link to comment
Share on other sites

Here is the line that throws the fatal error
 

13    $cases = $this->page->selected_cases->filter("limit=3");
14
15    if (count($cases) < 3) {
16       $cases->add(app()->randomPages($this->pages->get('/cases')->children->not("id=$cases"), 3 - count($cases)));
17    }
Link to comment
Share on other sites

Here is the line that throws the fatal error

13    $cases = $this->page->selected_cases->filter("limit=3");
14
15    if (count($cases) < 3) {
16       $cases->add(app()->randomPages($this->pages->get('/cases')->children->not("id=$cases"), 3 - count($cases)));
17    }

I don't think the fatal error is related to your Mac installation per se. You are getting the fatal error because $this->page->selected_cases isn't an object. That either means a) $this->page isn't an object or c) $this->page->selected_cases isn't an object. Now, it is hard to debug this for you because you are not telling us the context of your code. Are we inside a template, for an example? What kind of field (i.e. Fieldtype) is "selected_cases"? 

It would help if you could do

echo "Type of selected_cases: ".gettype($this->page->selected_cases)."<br />\n";
echo "Fieldtype of selected_cases: ".strval($this->page->fields->get("selected_cases")->type)."<br />\n";
echo "Page is an object: ".((isset($this->page) and is_object($this->page)) ? "yes":"no")."<br />\n";

...and then copy/paste us the output.

I can say in advance, if selected_cases is NULL, then I'd advise you to check the name of the field. Depending on the field, it could also be it's not holding any items (usually if it's holding multiple items it should then be an empty PageArray, for an example, and then filter() would work). The latter would be easy to fix by checking is_object($this->page->selected_cases). 

Anyway, if you want proper help, please fill in more details.

@horst He posted the errors in the original post

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...