[2.0] Smartifying the backend

Mark threads with "[2.0]" for discussions about features in the longer-term future, "[1.6]" is for short-term. This is not the place for general discussions or plugin or template requests. Only features that are approved to happen by the core team should be listed here for better structuring.
Locked
User avatar
Timbalu
Regular
Posts: 4598
Joined: Sun May 02, 2004 3:04 pm

Re: [2.0] Smartifying the backend

Post by Timbalu » Wed Apr 04, 2012 2:47 pm

@YL
Even if you change both of them?
What about disabling the first and have the 2cnd with require_once?

@Garvin
New Mysql 5x versions come with InnoDB as the default storage engine, AFAIK... but Serendipity needs MyIsam, at least for things like CREATE FULLTEXT INDEX. So it would be good to check this before install, wouldn't it?
Regards,
Ian

Serendipity Styx Edition and additional_plugins @ https://ophian.github.io/ @ https://github.com/ophian

User avatar
yellowled
Regular
Posts: 7072
Joined: Fri Jan 13, 2006 12:46 pm
Location: Eutin, Germany
Contact:

Re: [2.0] Smartifying the backend

Post by yellowled » Wed Apr 04, 2012 3:01 pm

Timbalu wrote:Even if you change both of them?
Yes.
Timbalu wrote:What about disabling the first and have the 2cnd with require_once?
That looks as if it works, i.e. it gives me a success message, but if I try to view the blog, it takes me back to the installation screen.

Also, the 2.0 does not get the url to the blog right, it populates the field with "http://www.example.com/serendipity" and I have to change it to the proper hostname manually.

YL
amazon Wishlist - Serendipity-Podcast (German only, sorry)

User avatar
Timbalu
Regular
Posts: 4598
Joined: Sun May 02, 2004 3:04 pm

Re: [2.0] Smartifying the backend

Post by Timbalu » Wed Apr 04, 2012 3:57 pm

Hmm, I have no other idea on this. It looks like your PHP configuration does not really know that include_once means include only once while processing... Did you ask your hoster about it? Normal LAMP servers should know...!

Yes, the default defaultBaseURL is 'http://www.example.com/serendipity/', to be changed manually in installation step 2a/b. Has there ever been something else with 1.6 or below?
Regards,
Ian

Serendipity Styx Edition and additional_plugins @ https://ophian.github.io/ @ https://github.com/ophian

User avatar
yellowled
Regular
Posts: 7072
Joined: Fri Jan 13, 2006 12:46 pm
Location: Eutin, Germany
Contact:

Re: [2.0] Smartifying the backend

Post by yellowled » Wed Apr 04, 2012 4:08 pm

Timbalu wrote:Hmm, I have no other idea on this. It looks like your PHP configuration does not really know that include_once means include only once while processing... Did you ask your hoster about it? Normal LAMP servers should know...!
I'm suspecting some hiccup between root and subdomains, but I won't touch anything unless the hoster's support gets back to me since I nearly shot my main blog (which is on the same space) just now. :mrgreen:
Timbalu wrote:Yes, the default defaultBaseURL is 'http://www.example.com/serendipity/', to be changed manually in installation step 2a/b. Has there ever been something else with 1.6 or below?
Erm, I've never had to edit that manually before, it has always detected the correct hostname automagically for as long as I can remember (which is 0.6).

YL
amazon Wishlist - Serendipity-Podcast (German only, sorry)

User avatar
yellowled
Regular
Posts: 7072
Joined: Fri Jan 13, 2006 12:46 pm
Location: Eutin, Germany
Contact:

Re: [2.0] Smartifying the backend

Post by yellowled » Wed Apr 04, 2012 5:26 pm

Trying to translate the answer from my (German) hoster as good as possible:

I kind of masked the original error message in order to not reveal my user data. The error message actually is like this:
Fatal error: Cannot redeclare serendipity_db_update() (previously declared in /var/www/virtual/username/html/include/db/db.inc.php:27) in /var/www/virtual/username/subdomain.domain.tld/include/db/db.inc.php on line 56
This means the installer is including a version of db.inc.php which is not the one in the subdomain's directory, but the one in DocumentRoot, which is confirmed by the fact that one of my test installations actually (but fixable) crashed my main blog in DocumentRoot.

So this means (according to my hoster's support) that the installer has a dependency on the DOCUMENT_ROOT variable which shouldn't be there.

According to the hoster's support, one solution is adding

Code: Select all

$_SERVER['DOCUMENT_ROOT'] = realpath('..');
at the beginning of serendipity_config.inc.php, but this doesn't sound like a very elegant solution since it needs to be changed again if the installation is in the root directory. Also, most of our users might not be comfortable with editing core files.

I am aware that this might only be an issue in my hoster's setup, but IMHO we should still check if there's a workaround for this in the installer since it's a hoster which is becoming increasingly popular in Germany and actually has a setup which is pretty great for s9y hosting. Plus, they know what they're doing. :)

YL
amazon Wishlist - Serendipity-Podcast (German only, sorry)

User avatar
yellowled
Regular
Posts: 7072
Joined: Fri Jan 13, 2006 12:46 pm
Location: Eutin, Germany
Contact:

Re: [2.0] Smartifying the backend

Post by yellowled » Wed Apr 04, 2012 5:35 pm

In another support mail, they recommended using dirname(__FILE__) to get the physical path to the s9y installation, whatever that might mean. :)

YL
amazon Wishlist - Serendipity-Podcast (German only, sorry)

User avatar
onli
Regular
Posts: 2253
Joined: Tue Sep 09, 2008 10:04 pm
Contact:

Re: [2.0] Smartifying the backend

Post by onli » Wed Apr 04, 2012 5:38 pm

yellowled wrote:
Timbalu wrote:Yes, the default defaultBaseURL is 'http://www.example.com/serendipity/', to be changed manually in installation step 2a/b. Has there ever been something else with 1.6 or below?
Erm, I've never had to edit that manually before, it has always detected the correct hostname automagically for as long as I can remember (which is 0.6).

YL
True. 2.0 broke that (that's why the simple installaiton isn't working atm). Ian, that should be based in your port of the installer to smarty (maybe that got transferred to smarty and accidentally hardcoded) . Can you look into it?

User avatar
Timbalu
Regular
Posts: 4598
Joined: Sun May 02, 2004 3:04 pm

Re: [2.0] Smartifying the backend

Post by Timbalu » Wed Apr 04, 2012 5:43 pm

yellowled wrote:Erm, I've never had to edit that manually before, it has always detected the correct hostname automagically for as long as I can remember (which is 0.6).
Yes; I would expect that too, but I wasn't sure remembering...
The funny thing is, it is <input class="input_textbox" size="30" name="baseURL" value="http://domain.de/test/serendipity160/ in 1.6 and in our 2.0 testcase 'defaultBaseURL' with the 'example.com' url. It must have to do with our change of installer.inc.php step 2a/b fetching the changed serendipity_printConfigTemplate() markup, which also points to serendipity_guessInput(), but I can't find the bug, I may have produced there. Please Garvin, Onli, have a fresh look inside.

Edit:
The baseURL bug is not inside the serendipity_printConfigTemplate() with new markup. I must be somewhere in installer.inc.php... still searching... need some more eyes!
Last edited by Timbalu on Wed Apr 04, 2012 7:43 pm, edited 2 times in total.
Regards,
Ian

Serendipity Styx Edition and additional_plugins @ https://ophian.github.io/ @ https://github.com/ophian

User avatar
blog.brockha.us
Regular
Posts: 695
Joined: Tue Jul 03, 2007 3:34 am
Location: Berlin, Germany
Contact:

Re: [2.0] Smartifying the backend

Post by blog.brockha.us » Wed Apr 04, 2012 7:37 pm

yellowled wrote:In another support mail, they recommended using dirname(__FILE__) to get the physical path to the s9y installation, whatever that might mean. :)
it means:

At line 243:
replace

Code: Select all

if (@file_exists($_SERVER['DOCUMENT_ROOT'] . dirname($_SERVER['PHP_SELF']) . '/serendipity_config_local.inc.php')) {
    $local_config = $_SERVER['DOCUMENT_ROOT'] . dirname($_SERVER['PHP_SELF']) . '/serendipity_config_local.inc.php';
with

Code: Select all

if (@file_exists(dirname(__FILE__) . '/serendipity_config_local.inc.php')) {
    $local_config = dirname(__FILE__) . '/serendipity_config_local.inc.php';
- Grischa Brockhaus - http://blog.brockha.us
- Want to make me happy? http://wishes.brockha.us/

User avatar
yellowled
Regular
Posts: 7072
Joined: Fri Jan 13, 2006 12:46 pm
Location: Eutin, Germany
Contact:

Re: [2.0] Smartifying the backend

Post by yellowled » Wed Apr 04, 2012 7:44 pm

blog.brockha.us wrote:
yellowled wrote:In another support mail, they recommended using dirname(__FILE__) to get the physical path to the s9y installation, whatever that might mean. :)
it means:
Thanks for clearing this up, but shouldn't this go into the s9y core then? Garvin?

YL
amazon Wishlist - Serendipity-Podcast (German only, sorry)

User avatar
blog.brockha.us
Regular
Posts: 695
Joined: Tue Jul 03, 2007 3:34 am
Location: Berlin, Germany
Contact:

Re: [2.0] Smartifying the backend

Post by blog.brockha.us » Wed Apr 04, 2012 7:47 pm

I think it should! This should work the same on normal and uberspace installations.
And PHP_SELF is often named as "evil"..

Did you try, if this solves your problem?
- Grischa Brockhaus - http://blog.brockha.us
- Want to make me happy? http://wishes.brockha.us/

User avatar
yellowled
Regular
Posts: 7072
Joined: Fri Jan 13, 2006 12:46 pm
Location: Eutin, Germany
Contact:

Re: [2.0] Smartifying the backend

Post by yellowled » Wed Apr 04, 2012 8:12 pm

blog.brockha.us wrote:Did you try, if this solves your problem?
Unfortunately, no. I didn't want to risk compromising my main blog by playing around with the subdomain installs any further, so I deleted them. I could of course install a new version if this needs further testing, but I wanted to check in with you guys first.

YL
amazon Wishlist - Serendipity-Podcast (German only, sorry)

User avatar
blog.brockha.us
Regular
Posts: 695
Joined: Tue Jul 03, 2007 3:34 am
Location: Berlin, Germany
Contact:

Re: [2.0] Smartifying the backend

Post by blog.brockha.us » Wed Apr 04, 2012 8:18 pm

Well, I don't really know what's your problem exactly..
I only know, that DOCUMENT_ROOT is a problem at uberspace when used in subdomains.
Perhaps there are other locations in the source where this is used..
- Grischa Brockhaus - http://blog.brockha.us
- Want to make me happy? http://wishes.brockha.us/

User avatar
yellowled
Regular
Posts: 7072
Joined: Fri Jan 13, 2006 12:46 pm
Location: Eutin, Germany
Contact:

Re: [2.0] Smartifying the backend

Post by yellowled » Wed Apr 04, 2012 8:36 pm

blog.brockha.us wrote:Well, I don't really know what's your problem exactly..
I only know, that DOCUMENT_ROOT is a problem at uberspace when used in subdomains.
Perhaps there are other locations in the source where this is used..
That's just it – I can't install properly in an uberspace subdomain because of the way s9y uses DOCUMENT_ROOT (at least that's what the support made of it, but I'm pretty sure they figured it out right :)). As a side effect, one of the installation compromised my main blog installation in DocumentRoot, but I was able to fix that.

YL
amazon Wishlist - Serendipity-Podcast (German only, sorry)

User avatar
garvinhicking
Core Developer
Posts: 30020
Joined: Tue Sep 16, 2003 9:45 pm
Location: Cologne, Germany
Contact:

Re: [2.0] Smartifying the backend

Post by garvinhicking » Thu Apr 05, 2012 1:02 pm

Hi!

This code is required for shared installations, we cannot simply change/remove it.

Installing s9y on a subdomain that has the document_root not set to the root of the subdomain, with a s9y on the main domain will never work. I don't see an easy way to patch this, without opening a huge can of worms for other currently working scenarios.

Can't you check with your provider if DOCUMENT_ROOT can be changed to the real path of the subdomains core directory properly?

Otherwise I suggest you to patch this on your installation only, the usual scenario is that DOUCMENT_ROOTs are "properly" set. There are scenarios of course where this is NOT wanted, so you can't really have it both ways...

Regards,
Garvin
# Garvin Hicking (s9y Developer)
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/

Locked