OJS OCS OMP OHS

You are viewing the PKP Support Forum | PKP Home Wiki



Installation errors

Are you responsible for making OJS work -- installing, upgrading, migrating or troubleshooting? Do you think you've found a bug? Post in this forum.

Moderators: jmacgreg, btbell, michael, bdgregg, barbarah, asmecher

Forum rules
What to do if you have a technical problem with OJS:

1. Search the forum. You can do this from the Advanced Search Page or from our Google Custom Search, which will search the entire PKP site. If you are encountering an error, we especially recommend searching the forum for said error.

2. Check the FAQ to see if your question or error has already been resolved.

3. Post a question, but please, only after trying the above two solutions. If it's a workflow or usability question you should probably post to the OJS Editorial Support and Discussion subforum; if you have a development question, try the OJS Development subforum.

Installation errors

Postby quinn » Thu Aug 30, 2007 8:37 am

I am trying to install OJS 2.1.1. I have copied the site to a browsable location and changed the permissions as per the README, however when I first browsed the site I got the following error:

Parse error: parse error, unexpected T_STRING, expecting ')' in /var/www/htdocs/ojs/ojs/cache/fc-locale-en_US.php on line 270

This appears to be caused by a single quote in the middle of a string in that file. There are dozens of such unescaped quotes, but since this file is generated by the installer I assume that the problem is with my configuration, rather than something in OJS. I went through and fixed them all just to see if it would work, however when I did that, I got this error:

Fatal error: Smarty error: [in install/install.tpl line 12]: syntax error: invalid attribute name: 'pageTitle\' (Smarty_Compiler.class.php, line 1535) in /var/www/htdocs/ojs/ojs/lib/smarty/Smarty.class.php on line 1095

Now I added a whole bunch of backslashes when I was escaping all those quotes, so it seems plausible that I caused this, but I can't track it down any further.

Any ideas on how to move forward with this?

Thanks,
Quinn
quinn
 
Posts: 16
Joined: Thu Aug 30, 2007 5:57 am

Re: Installation errors

Postby asmecher » Thu Aug 30, 2007 9:56 am

Hi Quinn,

What version of PHP are you using? It sounds like your var_export function is buggy.

Regards,
Alec Smecher
Public Knowledge Project Team
asmecher
 
Posts: 8869
Joined: Wed Aug 10, 2005 12:56 pm

Re: Installation errors

Postby quinn » Thu Aug 30, 2007 10:27 am

It's PHP 4.3.7 on apache 1.3.31. phpinfo() is disabled and I don't have admin privileges, but I'm happy to give any information I can find.
quinn
 
Posts: 16
Joined: Thu Aug 30, 2007 5:57 am

Re: Installation errors

Postby asmecher » Thu Aug 30, 2007 4:44 pm

Hi Quinn,

Just to double-check, could you delete all PHP files in cache/ and cache/t_compile and see if it behaves the same way again? If it does, please PM me with a copy of the generated buggy cache file.

Regards,
Alec Smecher
Public Knowledge Project Team
asmecher
 
Posts: 8869
Joined: Wed Aug 10, 2005 12:56 pm

Re: Installation errors

Postby quinn » Fri Aug 31, 2007 10:47 am

I've started playing around with the install template (templates/install/install.tpl) which is where the pageTitle token is coming from. Here is what it look like by default:

{assign var="pageTitle" value="installer.ojsInstallation"}

When smarty parses this, it reads "pageTitle\" as the attribute name. When I change the line to read:

{assign var="pageTitle " value="installer.ojsInstallation"}

(space added between pageTitle and the closing quote)

I get the following:

Fatal error: Smarty error: [in install/install.tpl line 12]: syntax error: expecting '=' after attribute name 'pageTitle' (Smarty_Compiler.class.php, line 1543) in /var/www/htdocs/ojs/ojs/lib/smarty/Smarty.class.php on line 1095

So now it's reading the identifier correctly, but obviously there is a syntax error.

Something I just discovered is that all the quotes are escaped when they are passed in to smarty for parsing. The actual string it reads from install.tpl is:

var=\"pageTitle\" value=\"installer.ojsInstallation\"

I suppose this belongs more on the smarty forums, but with the other problem being a lack of escaped quotes, I thought it might be related.

Hope this helps,
Quinn
Last edited by quinn on Fri Aug 31, 2007 11:01 am, edited 1 time in total.
quinn
 
Posts: 16
Joined: Thu Aug 30, 2007 5:57 am

Re: Installation errors

Postby asmecher » Fri Aug 31, 2007 10:56 am

Hi Quinn,

There's something very unusual about your host's PHP installation; I suspect if you're able to track down the var_export problem, it'll have the same root cause as the Smarty template problem.

Regards,
Alec Smecher
Public Knowledge Project Team
asmecher
 
Posts: 8869
Joined: Wed Aug 10, 2005 12:56 pm

Re: Installation errors

Postby quinn » Fri Aug 31, 2007 11:02 am

Ok, thanks, I'll investigate var_export next.

Quinn
quinn
 
Posts: 16
Joined: Thu Aug 30, 2007 5:57 am

Re: Installation errors

Postby quinn » Tue Sep 04, 2007 11:35 am

I managed to get OJS installed this afternoon. I deleted everything and started over, and the smarty compiler parsed the templates with no problems. I did have to use my edited version of the fc-locale-en_US.php because it was still being generated with invalid strings, but once I did that the install form loaded.

Running the install script properly created the database tables and populated them, but when it wrote out the new config.inc.php, the database password was in quotes. Because of this, anything I tried to do failed with a DB error. Once I figured out what happened and removed the quotes, everything worked again.

Now obviously I'm am going to encounter more errors any time a file is generated by OJS. I would like to track down the root cause for all of these problems (which you have suggested could be a bad var_export function) so this will stop. The only var_export bug I've found online seems unrelated, and it seems likely that people have run OJS before on my version of php, so it there anything else that would cause these problems? Or is there a way I can test my var_export to see whether or not it is the problem? If it is var_export I think it's probably due to some factor other than my version of php, so are there some settings somewhere that might help?

Perhaps I should be asking this stuff in a php support forum, but I figured I would check here first.

Thanks,
Quinn
quinn
 
Posts: 16
Joined: Thu Aug 30, 2007 5:57 am

Re: Installation errors

Postby asmecher » Tue Sep 04, 2007 11:52 am

Hi Quinn,

I responded to this thread but ended up posting it elsewhere by accident; see http://pkp.sfu.ca/support/forum/viewtopic.php?p=7512#p7512. If you can demonstrate the bug with a quick example script like the one provided there, it might be worth contacting your ISP with it to see if they can resolve it. I wasn't able to turn up any obvious PHP bugs either, so it might be a distribution-specific or custom modification that caused the problem.

I suspect that correcting this flaw, whatever it turns out to be, will probably correct a number of related problems.

Regards,
Alec Smecher
Public Knowledge Project Team
asmecher
 
Posts: 8869
Joined: Wed Aug 10, 2005 12:56 pm

Re: Installation errors

Postby quinn » Thu Sep 06, 2007 1:13 pm

I've found something that may help us understand the unescaped single quoting problem, and hopefully the root cause. This is regarding the generation of fc-locale-en_US.php by the installer.

In classes/i18n/Locale.inc.php, in the function loadLocale(), the en_US localization data is loaded from its XML file. In the XML file, there are many unescaped single quotes (actually apostrophes in the data) and later, this data is written as php code to the fc-locale-en_US.php file cache. When the file cache is included (classes/cache/FileCache.inc.php line 39), each unescaped quote causes a parse error.

I added an addslashes() so that when the XML data is read the specials get escaped properly, but I realize that this isn't the correct solution. I still have many other errors running OJS and I'm hoping this will lead us to the real problem.

Sorry for jumping back and forth between threads, but since this one was where this specific escaping problem first started, I used it.
quinn
 
Posts: 16
Joined: Thu Aug 30, 2007 5:57 am

Re: Installation errors

Postby quinn » Fri Sep 07, 2007 7:50 am

I may have discovered the source of my errors. I was using the UTF-8 selection for database connection & storage, but my mysql version is only 4.0.20! I reinstalled and left those as not applicable, and so far so good :) I did still have to ensure magic_quotes_runtime was off though, which fixed a smarty error I had.

Thanks so much,
Quinn
quinn
 
Posts: 16
Joined: Thu Aug 30, 2007 5:57 am

Re: Installation errors

Postby asmecher » Fri Sep 07, 2007 8:37 am

Hi Quinn,

Great! Glad to hear the problem is solved.

Regards,
Alec Smecher
Public Knowledge Project Team
asmecher
 
Posts: 8869
Joined: Wed Aug 10, 2005 12:56 pm


Return to OJS Technical Support

Who is online

Users browsing this forum: Google [Bot] and 4 guests

cron