Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 11/29/2015 in all areas

  1. I'm not completely convinced that the error happens where you think it does, driedstr. The Config class has no constructor at all, and Paths' one simply sets its $_root member variable. Have you tried downloading a copy of the online version and verifying with a directory diff tool like meld that the php files are really identical? Does a downloaded copy show the same error? If that doesn't help, also check INCLUDE_PATHs. Somewhere an identically named file might get included and cause the loop. If in doubt, xdebug could help you get a full trace and spot the offending file.
    2 points
  2. Hello horst. I haven't changed config.php beyond the required settings. Here it is, comments & sensitive data removed: <?php /** * ProcessWire Configuration File * [...] */ if(!defined("PROCESSWIRE")) die(); /*** SITE CONFIG *************************************************************************/ /** * Enable debug mode? * [...] */ $config->debug = false; /*** INSTALLER CONFIG ********************************************************************/ /** * Installer: Database Configuration * */ $config->dbHost = /* [...] */; $config->dbName = /* [...] */; $config->dbUser = /* [...] */; $config->dbPass = /* [...] */; $config->dbPort = /* [...] */; /** * Installer: User Authentication Salt * [...] */ $config->userAuthSalt = /* [...] */; /** * Installer: File Permission Configuration * */ $config->chmodDir = '0755'; // permission for directories created by ProcessWire $config->chmodFile = '0644'; // permission for files created by ProcessWire /** * Installer: Time zone setting * */ $config->timezone = 'America/Toronto'; /** * Installer: HTTP Hosts Whitelist * */ $config->httpHosts = array('artsdeir.ca', 'www.artsdeir.ca'); Hi Webrocker. The site has maybe a few dozen page objects, so I don't think it's that. The heavy lifting that the site does is in some form processing. After checking the incoming form data, it's encrypted with libsodium and stashed in an sql table as a blob. A module I developed allows the admin to list the stored entries without decrypting them, then select one for download. The download process involves decrypting the blob data, generating a PDF with dompdf, then encrypting that with phpaes. The resulting .aes files are ~3kb, and temp files are being deleted properly as far as I can see. A few items pop to the top of top when requesting the site. Nothing breaks 1% CPU or 2.1% MEM: httpd nginx sp-agent mysqld Hi cstevensjr. Here are the serverpilot apache and nginx config files. I had tried a few things with nginx main.custom.conf, but reverted to default when I was unsuccessful and deleted the file. The goal was to try to set up an unsigned SSL certificate to use with CloudFlare's free service (without paying for the next tier of serverpilot), but I might just buy it from serverpilot. I haven't used nginx before, so that part of the server config is fairly opaque to me. apache main.conf and main.custom.conf (identical): AcceptPathInfo on DirectoryIndex index.html index.htm index.php <Directory ${DOCUMENT_ROOT}> AllowOverride All Require all granted RewriteCond %{DOCUMENT_ROOT}/%{REQUEST_URI} !-f RewriteRule \.php$ - [R=404] </Directory> RewriteEngine On RewriteCond %{HTTP:Authorization} .+ RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}] <Files *.php> SetHandler proxy:${PHP_PROXY_URL} </Files> <Proxy ${PHP_PROXY_URL}> ProxySet timeout=3600 retry=0 </Proxy> nginx main.conf: location / { proxy_pass $backend_protocol://$backend_host:$backend_port; } Thank you all for your help!
    2 points
  3. Hi @driedstr and welcome to the forums. If you are sure it is this line when start building $config, it can be worth to have a look what you put into your site/config.php ?? Have you put customized stuff / settings into it?
    2 points
  4. I am guessing they are related... Applying this to your case... It means line 119 refers to the script where the header() invocation failed (i.e. in shutdown.php). However, the source is line 19 in WireData.php. In my PW version, that's the beginning of the Class WireData. So unless you touched that, then it is probably something calling WireData.php that's failing.. Hard to tell though. The last time I got this error was trying to delete some page via API and it didn't work and it got stuck in memory and had to restart Apache...I know this is probably not too helpful...
    2 points
  5. Hi driedstr, Welcome to PW and the forums. Here are some typical causes of that PHP error: http://stackoverflow.com/questions/8028957/how-to-fix-headers-already-sent-error-in-php Any of those apply to you?
    2 points
  6. Hi @totoff, it depends on what tasks I want apply to a site. If it only rely on template files, css and js files, I switch from regular to dev-files. Means, I use a little abstraction layer for including my files like this: $myMainJSfile = "scripts/main.js"; $myMainCSSfile = "styles/main.css"; When working on a live site, I use something like this: if($user->isSuperuser()) { $config->debug = true; $myMainJSfile = "scripts/main.dev.js"; $myMainCSSfile = "styles/main.dev.css"; } else { $myMainJSfile = "scripts/main.js"; $myMainCSSfile = "styles/main.css"; } When working on templatefiles, I put in the top of the template file a few lines of code: if($user->isSuperuser()) { include("./nameOfMyTemplateFile.dev.php"); return; } This switches to a dev version of the template file and returns directly after including it. (The code of the original isn't executed). This is a basic description. Depending on how you have organized your site, there is a lot room for improvements, go into depth, make it a more granular system. But you get the idea. If I need to alter the DB too, I use a separate site/config.dev.php too. YOu can read about it here, scroll down to the end: "Maintaining a separate development configuration file". (I duplicate the DB to a dev-version and connect to it for development)
    2 points
  7. additionally you could/should set $config->debug = true; in the site/config.php. So, maybe it isn't of help in this case.
    1 point
  8. I'm happy to share the recent re-launch of the website for the Smart City Alliance, an organization that promotes knowledge sharing and collaboration between Alberta municipalities, academic institutions, technology advocacy groups and business. Their previous website was built (oddly) as a Ruby-based application, and I managed to completely rebuild the site (while enhancing both the design and functionality) within a 2.5 week window while handling other projects. View the site: http://smartcityalliance.ca/ - - - - - - Front-End Fanciness: - Fully responsive design - SRCSet for key images Modules in Action: - AIOM+ (All In One Minify) - Hanna Code - Map Marker (Field Type) - Twitter Feed Markup Leverging Processwire: - Powerful use of pagefields (for the tagging system) - Advanced caching rules for all template types - Easily generated a variety of specific RSS feeds
    1 point
  9. Yes. Use getQueryLog() (will only work with debug on) See example code here: https://processwire.com/talk/topic/11483-duplication-in-query-results/?p=106994
    1 point
  10. Here we are Luis.... just set up a public repo: https://github.com/mr-fan/Officesuite Just created a exported siteprofile from a actual 2.7.1 PW version. So every one could install it simple as a site profile. Now the last question is the license and your permissions and wishes about that topic. May we should go with GPL or release it as simple Public Domain: http://choosealicense.com/licenses/ For me i think it could only stay as a example application for learning some stuff - the app itself can only used partly while some things in accounting and billing changed and everyone that use this app should care about this things (for example IBAN and BIC instead of banking accont number...) But it is your piece of work and it is your decision. @all - this is a german language application and for multiligual frontend we have to change every hardcoded string in the templates....so to a multilang working out of the box app some work is on the road...that i could not do alone. So every one that is interested in helping could send me a PM for further work on this - or every one could use it as it is... regards mr-fan
    1 point
  11. I read this over and over. What stood out, to me, was these two statements: I don't know what effect this has on the stated problem, however a little more information regarding that configuration (ServerPilot Apache/Nginx config files), I believe, is warranted. In addition, what @kongondo stated in reply #2 is where the PW error logs would lead one to first try to eliminate/rule out.
    1 point
  12. Hi @driedstr welcome to the forum I'm with @horst on that - most likely there's something in your site/config that's working fine in your local env, but not on the server. I had some memory alloc errors with processwire, but usually only with extensive api things working on several thousand page objects. Maybe looking directly on the server with 'top' gives a clue what eats the memory? cheers tom
    1 point
  13. Is there a specific reason you're running a MySQL query first? Could you rewrite this part to use one PW selector? Such as... template=event_item, shows_relation.date>2015-11-28, shows_relation.date<2016-01-15
    1 point
  14. Database speed is very fast....Just don't retrieve all your 10K pages at once ....Use 'limit' in your selector and you will be fine. Welcome to PW and the forums
    1 point
  15. In my _main.php files I typically include a "layout" variation file. This is what you would start with as the main template, but moved outside to allow more customisation and flexibility. Specify a default layout to use in the _init.php file, and overwrite it in your template files as and when necessary. _main.php <html> <head> <style></style> ... </head> <body> <header class="header">...</header> <section class="main"><?php require "./includes/layouts/{$layout}.php"; ?></section> <footer class="footer">...</div> </body> </html> _init.php $layout = 'default'; // specify a layout that would be used for "most" pages (I call mine default) So most sites might have default, home and contact layout varieties as a starting point. A layout would include the stuff that varies between page designs and you would create as few or as many as you need, and call on the variables set by the template. For example, layouts/contact.php: <section class="content"> <p>This is our address</p> <?= $page->body ?> </section> <aside> <iframe class="map">...</iframe> </aside>
    1 point
  16. I just quickly built a menu using: $navItems = $pages->get("/")->children("template!=syllabi"); That creates a 2 level menu with 15 parents, and about 65 children. Without any markupCache total time: 0.6733 With MarkupCache total time: 0.0018 I tested them like so: $t = Debug::timer(); echo navList($p); echo Debug::timer($t); $t = Debug::timer(); $cache = $modules->get("MarkupCache"); if(!$data = $cache->get("menu-test")) { $data = navList($p); $cache->save($data); } echo $data; echo Debug::timer($t);
    1 point
  17. I'm not exactly sure what you're thinking "combine" means here, but this field does exactly what the description says; it grabs data from other fields, mashes it all together into one big blob of (JSON) content -- and that's just about it. One very simple (yet sometimes very practical) use case is if you've got, say, 15 different text fields and you need to find pages that contain value "john doe" in any of those. Instead of doing this: $john_does = $pages->find('field1|field2|field3|field4|field5|...|field15%="john doe"'); .. you can create a cache field, select all of those fields to be cached in it, and then do this: $john_does = $pages->find('my_cache_field%="john doe"'); Not only does this look clean, in certain situations it can wildly improve query performance.
    1 point
  18. I like Dragan's approach if you don't mind mixing JS into the CMS side of things. Whether that's a good practice or not really depends on who's going to be using the admin. If you want to keep this on the development side rather than the content side, one approach I've used is to keep JS files named with the ID of the page. When a JS file existed that matched the ID of the page, it would be included in the <head> section. Example: <?php $file = "scripts/$page->id.js"; if(is_file($config->paths->templates . $file)) { echo "<script src='{$config->urls->templates}$file'></script>"; } More often, I use this approach with the template file, i.e. have a file named basic-page.js that gets included on any pages using the basic-page template.
    1 point
×
×
  • Create New...