Jump to content

nixsofar

Members
  • Posts

    13
  • Joined

  • Last visited

Recent Profile Visitors

663 profile views

nixsofar's Achievements

Jr. Member

Jr. Member (3/6)

4

Reputation

1

Community Answers

  1. @abdus: Looks like the information I was after. Thanks a lot! Edit: Unfortunately no effect. Isn't there maybe anything to do at template level? Edit #2: Success after another module un/reinstall- No idea what I did wrong the first time. – Thanks again!
  2. There might be an obvious answer, but I can't figure it out: I have an admin page containing custom HTML, based on the ProcessSimpleAdminPage module As intended, it shows an extra tab in the admin area next to "Pages", "Setup", "Modules", "Access" for the superuser. There is a role "editor" with permissions that let them only see the "Pages" tab. How can I achieve that such an "editor" can also see the custom tab in addition to "Pages"?
  3. @Steve Too much honour, sorry, no secret super-tool in my belt... Just vim, ctags, find, grep, <?php die($info) ?> , frequently with __FILE__, __FUNCTION__, __LINE__ information etc Thanks again for your time everybody!
  4. Edit This was the second time I had a hard time debugging a mysterious "processwire error". My lesson: I will keep in mind that there are circumstances when neither pw, php nor the server software can give me appropriate error messages or log entries. So first thing if firefox tells me 'Unable to complete this request due to an error' next time will be checking config.php for syntax errors $ php -l site/config.php and if I get an empty server response because of an apache segfault like "The connection was reset" (http) or "Secure Connection Failed" (https) I'll very carefully check all my own code in site/templates. If necessary, by disabling and re-enabling script by script. -- Found my stupid error. It was in this little function in _func.php that should retrieve the second level parent of a page: function getsubpar($page){ $parid = $page->parent->id; ## if($parid == 1){ ##### WRONG! CAUSES APACHE SEGFAULT if($parid <= 1){ return $page; }else { $subpar = getsubpar($page->parent); return $subpar; } } With parent id 0 it would recurse forever. Can't expect error messages from a crashed Apache module. Still strange the crash happened exactly at this line in TemplateFile.php There might be a better way to get these subparents, but pw is working again, problem solved. Thanks to all!
  5. Thanks Steve! Among others I've done exactly these diff jobs but they gave no clue. New pw installs do work, so I guess next I'll rebuild the site step by step and watch what's happening.
  6. Thanks for replying guys! @cstevensjr: yes and yes. The problem installation used to work ok as well before I did whatever to break it. @netcarver: yes, checked in line 179. Permissions and owner are ok, too. What happens is a segfault in one or several Apache child processes. I did an Apache and Php5 reinstall, but no luck.
  7. There are other PW installations running on this server w/o problem. So probably no Apache or PHP version issue either.
  8. Yes, definitely no browser issue. Chrome: ERR_EMPTY_RESPONSE Wget: HTTP request sent, awaiting response... No data received. Retrying.
  9. I have an odd issue with PW 2.7.2 on a Debian 8.4 server, Apache 2.4.10, PHP 5.6.19-0+deb8u1 From a certain point I was getting an empty server response when calling any page (Firefox http: "The connection was reset", https: "Secure Connection Failed" / "The connection to the server was reset while the page was loading.") I've tracked it down to wire/core/TemplateFile.php, line 180 require($_filename); I can exit ok before this line, but an exit() at the next line won't be reached Except for the debug lines, all files in the wire directory tree are left unchanged Additionally I've checked all files for syntax errors $ find . -regex '^.*\.\(php\|module\|inc\)$'|grep -v '\.phpstorm\.meta\.php' | xargs -i php -l {} | grep -v 'No syntax errors' after having had a similar experience as a result of a typo in config.php This is the context: wire/core/TemplateFile.php 154 /** 155 * Render the template -- execute it and return it's output 156 * 157 * @return string The output of the Template File 158 * @throws WireException if template file doesn't exist 159 * 160 */ 161 public function ___render() { 162 163 if(!$this->filename) return ''; 164 if(!file_exists($this->filename)) { 165 $error = "Template file does not exist: '$this->filename'"; 166 if($this->throwExceptions) throw new WireException($error); 167 $this->error($error); 168 return ''; 169 } 170 171 $this->savedDir = getcwd(); 172 173 chdir(dirname($this->filename)); 174 $fuel = array_merge($this->getArray(), self::$globals); // so that script can foreach all vars to see what's there 175 176 extract($fuel); 177 ob_start(); 178 foreach($this->prependFilename as $_filename) { 179 if($this->halt)break; 180 die( "regular exit here"); ###### DEBUG 181 require($_filename); ####### PROBLEM HERE! ###### 182 die("won't exit here - empty server response instead"); ###### DEBUG 183 184 } 185 if(!$this->halt) require($this->filename); 186 foreach($this->appendFilename as $_filename) { 187 if($this->halt) break; 188 require($_filename); 189 } 190 $out = "\n" . ob_get_contents() . "\n"; 191 ob_end_clean(); 192 193 if($this->savedDir) chdir($this->savedDir); 194 195 return trim($out); 196 } Any ideas how to debug this?
  10. Was not able to solve this issue with 2.7.0 As of 2.7.1 no more problem. Thanks for your ideas.
  11. I want to run processwire at example.com/subdir. If I install PW 2.6.1 - no problem at all. If I repeat exactly the same few super simple steps with PW 2.7.0, example.com/subdir/processwire gives me a 404 not found error already from the "Login to admin" button at install.php. Tried several times. What can I possibly be missing?
  12. Thanks for your answers! And the hint about the google search. Unfortunately, it doesn't deliver any result for $pages->add (except this very post here.) Highly praised as the API cheatsheet is everywhere, I'd really suggest either to keep it exhaustive or to add a notice that it isn't. Asking newbies to dig in the source code for extremely convenient functions like this is not really an option in my eyes. Just my opinion. Still very excited and thankful about PW!
  13. Hi! New to Processwire, built one site with it and a great big fan already. Not that it was too hard to figure this one out, but where in the reference docs would I find the syntax of $newpage = $pages->add ( template, parent, url, array ( field => content, ... ) besides the generic $a->add($item)? Don't want to miss anything similar
×
×
  • Create New...