OJS OCS OMP OHS

You are viewing the PKP Support Forum | PKP Home Wiki



Problem upgrading from version ojs-2.1.0-1 to 2.1.1

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.

Problem upgrading from version ojs-2.1.0-1 to 2.1.1

Postby renatem » Fri Apr 27, 2007 3:04 pm

I di the upgrade from ojs version 2.1.0 to 2.1.1 with the patch file. However, thee were many error messages that especially in the /cache folder files could not be patched. So I said to skip. Will the system be working ok?

Another problem was the ./classes/db/DAO.inc.php file. There is a problem with the PHP check version on line 27:
function DAO($dataSource = null, $callHooks = true) {
if ($callHooks === true && checkPhpVersion('4.3.0')) {

I then copied the old version over it and then system came up again. I am using PHP 4.2.2. But I am sure that is not correct - what should I change in the file to let it work?
renatem
 
Posts: 16
Joined: Tue Apr 10, 2007 4:09 pm

Postby asmecher » Fri Apr 27, 2007 3:16 pm

Hi Renatem,

If you only received patching errors for files in the cache directory, I'd suggest erasing all files in it -- leave the directories in place, though -- and making sure the web server has write access. They'll all be regenerated as necessary. If there's anything that couldn't be patched outside of the cache directory, though, it may cause problems.

I'm not sure what you mean regarding PHP versions. The function that is called for PHP versions greater than 4.3.0 is purely optional and relates to plugins; if the version check is working properly, it'll be skipped for your version of PHP and you shouldn't have to worry about it. Are you getting error messages?

Regards,
Alec Smecher
Open Journal Systems Team
---
Don't miss the First International PKP Scholarly Publishing Conference
July 11 - 13, 2007, Vancouver, BC, Canada
http://ocs.sfu.ca/pkp2007/
asmecher
 
Posts: 8831
Joined: Wed Aug 10, 2005 12:56 pm

PHP checking problem

Postby renatem » Sat Apr 28, 2007 3:13 pm

Thanks for the reply.
I copied the old file over the new patched file and then I could open our site again, before this the error with the problem of PHP check came up.

I enabled the RSS feed button, but the RSS button is not showing. We have not published an issue yet.
The counter plugin give the following error message.
How could i fix this?
Thanks
Renate

Warning: fopen("/var/www/html/ndj/plugins/generic/counter/log.txt", "r") - No such file or directory in /var/www/html/ndj/plugins/generic/counter/LogEntryDAO.inc.php on line 65

Warning: Invalid argument supplied for foreach() in /var/www/html/ndj/plugins/generic/counter/CounterHandler.inc.php on line 28

Warning: Cannot add header information - headers already sent by (output started at /var/www/html/ndj/plugins/generic/counter/LogEntryDAO.inc.php:65) in /var/www/html/ndj/classes/template/TemplateManager.inc.php on line 187
renatem
 
Posts: 16
Joined: Tue Apr 10, 2007 4:09 pm

Postby asmecher » Sat Apr 28, 2007 5:37 pm

Hi Renatem,

See plugins/generic/counter/README for instructions on how to use the counter plugin; you need to create the log file.

If you could describe the problem you had with the PHP version check in more detail, I may be able to help.

Regards,
Alec Smecher
Open Journal Systems Team
---
Don't miss the First International PKP Scholarly Publishing Conference
July 11 - 13, 2007, Vancouver, BC, Canada
http://ocs.sfu.ca/pkp2007/
asmecher
 
Posts: 8831
Joined: Wed Aug 10, 2005 12:56 pm

Problem claring data cache

Postby renatem » Sun Apr 29, 2007 1:41 am

Hi again,

While testing the site after the upgrade I noticed that I can't clear the data cache.

Fatal error: Call to undefined function: glob() in /var/www/html/ndj/classes/cache/CacheManager.inc.php on line 81


Renate
renatem
 
Posts: 16
Joined: Tue Apr 10, 2007 4:09 pm

Postby asmecher » Mon Apr 30, 2007 9:38 am

Hi Renate,

It looks like an incompatibility between OJS 2.1.1 and your version of PHP (< 4.3.0). You can work around it by including a file from index.php with the following contents:
Code: Select all
<?php

if (!defined('GLOB_MARK')) define('GLOB_MARK', 2);
if (!defined('GLOB_ONLYDIR')) define('GLOB_ONLYDIR', 8192);
if (!defined('GLOB_NOSORT')) define('GLOB_NOSORT', 4);

//safe_glob() by BigueNique at yahoo dot ca
//Function glob() is prohibited on some servers for security reasons as stated on:
//http://seclists.org/fulldisclosure/2005/Sep/0001.html
//(Message "Warning: glob() has been disabled for security reasons in (script) on line (line)")
//safe_glob() intends to replace glob() for simple applications
//using readdir() & fnmatch() instead.
//Since fnmatch() is not available on Windows or other non-POSFIX, I rely
//on soywiz at php dot net fnmatch clone.
//On the final hand, safe_glob() supports basic wildcards on one directory.
//Supported flags: GLOB_MARK. GLOB_NOSORT, GLOB_ONLYDIR
//Return false if path doesn't exist, and an empty array is no file matches the pattern
if (!function_exists('glob')) {
        function glob($pattern, $flags=0) {
                $split=explode('/',$pattern);
                $match=array_pop($split);
                $path=implode('/',$split);
                if (($dir=opendir($path))!==false) {
                        $glob=array();
                        while(($file=readdir($dir))!==false) {
                                if (fnmatch($match,$file)) {
                                        if ((is_dir("$path/$file"))||(!($flags&GLOB_ONLYDIR))) {
                                                if ($flags&GLOB_MARK) $file.='/';
                                                $glob[]=$file;
                                        }
                                }
                        }
                        closedir($dir);
                        if (!($flags&GLOB_NOSORT)) sort($glob);
                        return $glob;
                } else {
                        return false;
                }
        }
}

//thanks to soywiz for the following function, posted on http://php.net/fnmatch
//soywiz at php dot net
//17-Jul-2006 10:12
//A better "fnmatch" alternative for windows that converts a fnmatch pattern into a preg one. It should work on PHP >= 4.0.0
if (!function_exists('fnmatch')) {
        function fnmatch($pattern, $string) {
                return @preg_match('/^' . strtr(addcslashes($pattern, '\\.+^$(){}=!<>|'), array('*' => '.*', '?' => '.?')) . '$/i', $string);
        }
}

?>
Let me know how it works.

Alternately, you can clear the cache by removing all .php files from the cache directory and all files from the cache/t_compile directory. (It's probably best to use the fix above, though, because the missing "glob" function is used elsewhere.)

Regards,
Alec Smecher
Open Journal Systems Team
---
Don't miss the First International PKP Scholarly Publishing Conference
July 11 - 13, 2007, Vancouver, BC, Canada
http://ocs.sfu.ca/pkp2007/
asmecher
 
Posts: 8831
Joined: Wed Aug 10, 2005 12:56 pm

Upgrading from OJS 2.1.0 - 2.1.1

Postby renatem » Mon Apr 30, 2007 11:29 am

Hi again,

I had a look at the rejected files, and after I had copied the patched DAO.inc.php from 27 April over the 'old' one (which I copied from the previous version of my backup) the problem with the PHP check was gone.
However, when I want to clear the data cache the problem is still there.

The RSS feed button is still not visible - where should I check for this problem, or should we have published an issue first?

Thanks
Renate
renatem
 
Posts: 16
Joined: Tue Apr 10, 2007 4:09 pm

Postby asmecher » Mon Apr 30, 2007 2:55 pm

Hi Renate,

The fix described at http://pkp.sfu.ca/support/forum/viewtopic.php?p=6027#6027 will correct the problem with the glob function (and should get the "Clear data cache" function working). As for the RSS link, it'll appear once you've published an issue.

Regards,
Alec Smecher
Open Journal Systems Team
---
Don't miss the First International PKP Scholarly Publishing Conference
July 11 - 13, 2007, Vancouver, BC, Canada
http://ocs.sfu.ca/pkp2007/
asmecher
 
Posts: 8831
Joined: Wed Aug 10, 2005 12:56 pm


Return to OJS Technical Support

Who is online

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