Welcome to Geeklog, Anonymous Thursday, April 18 2024 @ 07:42 am EDT

Geeklog Forums

static pages 1.3 + geeklog 1.3.8, PHP not working


Status: offline

ascott

Forum User
Junior
Registered: 06/05/03
Posts: 27
Hi Everybody, I\'m new to this list, (have never posted before), but I\'ve been reading a lot and have done my homework. I\'m trying to get php code in static pages to work and nothing seems to happen. At first it was a silly error on my part, where I didn\'t have the correct version of static pages that allowed for PHP code, but now I\"ve upgraded to latest geeklog, which has the latest static pages. I get the option to turn on PHP code at the bottom of my static page editor window, I check it and I still see my raw code in the output. I\'ve tried without php tags and with, as well as have tried with the PHP enabled radio checkbox checked and unchecked and I can\'t seem to get this to work. Is there something else that I might be missing? Is there an option in some config file that needs to be set or a value in the DB that needs to be toggled? Thank developers for all your rad efforts, I hope to contribute some knowledge of my own back to project as I will undoubtedly be using Geeklog and friends a lot. Any help would certainly be mucho appreciated. Sincerely, Andrew
 Quote

Status: offline

Dirk

Site Admin
Admin
Registered: 01/12/02
Posts: 13073
Location:Stuttgart, Germany
I assume you've read the documentation? The minimal example for the use of PHP in a static page would be something like
Text Formatted Code
return 'Hello, world';
If the "PHP" checkbox for the static page is checked, this should simply display Hello, world in the static page. If instead it displays the entire statement (including the return) then PHP is not enabled for that page. I'm not sure how that could happen, though - you may want to check that the field 'sp_php' is set to 1 for this static page in the database. bye, Dirk
 Quote

Status: offline

ascott

Forum User
Junior
Registered: 06/05/03
Posts: 27
Hey Dirk, yes, sp_php is set to 1 in the database for that page. Is there something else that I might be missing? I still get the full \"return \"hello, world\";\" in the page. Thanks for your prompt reply and assistance, Andrew
 Quote

Status: offline

Dirk

Site Admin
Admin
Registered: 01/12/02
Posts: 13073
Location:Stuttgart, Germany
The only other thing I could think of is that you still have some of the files from the old static pages plugin. You mentioned that you upgraded - maybe you\'ve missed a file? bye, Dirk
 Quote

Status: offline

ascott

Forum User
Junior
Registered: 06/05/03
Posts: 27
I\'ve checked all the perms for the static page user as well. It hs the staticpages.PHP perms, which are hardcoded in the newer versions of gL and SP that i\'m using. I\'m making the page as teh root admin, which is part of static pages group, etc... so that should all be fine. Is there some code somewhere that says \"if static page is made by admin, don\'t execute PHP\" for security reasons? If so, I haven\'t been able to detect it. I can send you the link but it won\'t do much good just to see it fail to execute PHP without being able to log in. Also, i haven\'t really secured my install of GL yet, so bit shy to put a link in a forum. -Andrew
 Quote

Status: offline

ascott

Forum User
Junior
Registered: 06/05/03
Posts: 27
cool. thanks for your time dirk. No, when I upgraded I moved the old install over and installed everything from scratch, doing the database \"upgrade\" option for the install, etc... Everything else looks like it did, so I don\'t think I broken anything between the fresh install and the upgraded db. All new files.
 Quote

Status: offline

ascott

Forum User
Junior
Registered: 06/05/03
Posts: 27
Hey, I got it. a value needed to be toggled in my php.ini file that debian set up by default: assert.quiet_eval = true This was commented out to begin with, and according to the comments it is supposed to be for error reporting or not, but when uncommented it and set the value to \"true\", the static pages started to display my PHP code. Not sure why this value makes a difference, but that was the trick. -Andrew
 Quote

All times are EDT. The time is now 07:42 am.

  • Normal Topic
  • Sticky Topic
  • Locked Topic
  • New Post
  • Sticky Topic W/ New Post
  • Locked Topic W/ New Post
  •  View Anonymous Posts
  •  Able to post
  •  Filtered HTML Allowed
  •  Censored Content