Page 8 of 12

Re: [2.0] Smartifying the backend

Posted: Wed Apr 04, 2012 2:47 pm
by Timbalu
@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?

Re: [2.0] Smartifying the backend

Posted: Wed Apr 04, 2012 3:01 pm
by yellowled
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

Re: [2.0] Smartifying the backend

Posted: Wed Apr 04, 2012 3:57 pm
by Timbalu
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?

Re: [2.0] Smartifying the backend

Posted: Wed Apr 04, 2012 4:08 pm
by yellowled
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

Re: [2.0] Smartifying the backend

Posted: Wed Apr 04, 2012 5:26 pm
by yellowled
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

Re: [2.0] Smartifying the backend

Posted: Wed Apr 04, 2012 5:35 pm
by yellowled
In another support mail, they recommended using dirname(__FILE__) to get the physical path to the s9y installation, whatever that might mean. :)

YL

Re: [2.0] Smartifying the backend

Posted: Wed Apr 04, 2012 5:38 pm
by onli
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?

Re: [2.0] Smartifying the backend

Posted: Wed Apr 04, 2012 5:43 pm
by Timbalu
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!

Re: [2.0] Smartifying the backend

Posted: Wed Apr 04, 2012 7:37 pm
by blog.brockha.us
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';

Re: [2.0] Smartifying the backend

Posted: Wed Apr 04, 2012 7:44 pm
by yellowled
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

Re: [2.0] Smartifying the backend

Posted: Wed Apr 04, 2012 7:47 pm
by blog.brockha.us
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?

Re: [2.0] Smartifying the backend

Posted: Wed Apr 04, 2012 8:12 pm
by yellowled
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

Re: [2.0] Smartifying the backend

Posted: Wed Apr 04, 2012 8:18 pm
by blog.brockha.us
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..

Re: [2.0] Smartifying the backend

Posted: Wed Apr 04, 2012 8:36 pm
by yellowled
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

Re: [2.0] Smartifying the backend

Posted: Thu Apr 05, 2012 1:02 pm
by garvinhicking
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