OJS OCS OMP OHS

You are viewing the PKP Support Forum | PKP Home Wiki



OJS, PHP 5.3.6 and Blank Pages

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.

Re: OJS, PHP 5.3.6 and Blank Pages

Postby blstzus » Wed Jul 11, 2012 6:26 pm

acardh wrote:OK guys, I have solved the problem. The issue was generated by wrong file permissions, PHP cold not read some needed files. So, I set recursively the file permissions to 755 on all the files and directories. Only the directories "cache", "public" and the one created for the upload of files are set to 777 permissions.
In order to set recursively the file permissions in the "lib" directory, you can use:
Code: Select all
chmod -R 755 lib/

The same for all the other directories and files.
That's it, that did the trick.
8)

Next I will put a post with all the steps that I followed from the beginning for the setup of the OJS. I guess that might be useful as a future reference. :wink:


Hi, had the same problem as in this thread when moving my journal from a server to another. I did all the steps in the FAQ and get blank page. In the apache erro log it says:
Code: Select all
[Thu Jul 12 08:39:45 2012] [error] [client 127.0.0.1] PHP Warning:  require(./lib/pkp/includes/bootstrap.inc.php): failed to open stream: Permission denied in /var/www/journal/index.php on line 61
[Thu Jul 12 08:39:45 2012] [error] [client 127.0.0.1] PHP Fatal error:  require(): Failed opening required './lib/pkp/includes/bootstrap.inc.php' (include_path='.:/usr/share/php:/usr/share/pear') in /var/www/journal/index.php on line 61

I also did the steps above. Everything's okay except that when I do for include, it says:
Code: Select all
chmod -R 755 includes/
chmod: cannot access `includes/': No such file or directory

:?
When I tried to go to localhost/journal on my web browser, still blank page. But, there are no error recorded in apache2 error.log.

Is my problem the same as treydock's above? If yes, how do I "change the owner of the application to the apache user" as pointed out by ramon?
ramon wrote:Hello Trey,

Very difficult to identify what is going on without actually looking directly at your server.
Did you make sure to change owner of the application to the Apache user?


Thank you in advance for the help. Been working on this for a few weeks already. :cry:

-Aiman-
blstzus
 
Posts: 16
Joined: Mon Apr 26, 2010 12:08 am

Re: OJS, PHP 5.3.6 and Blank Pages

Postby ramon » Thu Jul 12, 2012 7:57 am

Hello Aiman,

If your host is using a Debian/Ubuntu-based Linux server, then you can run on the comman-line (if you have SSH access to it..):
Code: Select all
ps -ef | grep apache

This will tell you what the Apache user is.

Then, you will use the chown (CHange OWNer) command to make that user the owner of the application.
The following assumes the Apache user AND group are named www-data (very common in Debian and Ubuntu):
Code: Select all
chown -Rf www-data:www-data ojs2


OJS SHOULD run smoothly in most setups with 644 permission in all folder except the following:
  • public
  • cache
  • locale (for language fixing via Translation Plugin)
  • lib/pkp/locale (same as above)
  • plugins (if you want to install new plugins via the interface and use the Custom Translation plugin and maybe others and for the same reason as the 2 previous ones)

These should work on most setups with 755 permissions, but it varies according to your hosting rules.

Looking at your error messages it could mean that PHP is not allowed to use another path for includes.
You may have to change php.ini to add the path to your /var/www folder or something like that.

Also, make sure you have all the folders and OJS install requires.
Sometimes the decompression on a Windows machine doesn't go as planned and some folders may be missing.
FTP clients may mess up permissions as well or not fully transfer everything... who knows.. dwarfs exist and they live in computers...
_______________________________
Ramón Martins Sodoma da Fonseca
Analista em C&T
Coordenação de Tecnologias de Informação
Instituto Brasileiro de Informação em Ciência e Tecnologia - IBICT
Ministério da Ciência e Tecnologia - MCT
ramon
 
Posts: 931
Joined: Wed Oct 15, 2003 6:15 am
Location: Brasí­lia/DF - Brasil

Re: OJS, PHP 5.3.6 and Blank Pages

Postby edmendel » Mon Jul 16, 2012 7:22 pm

Olá Ramon.
Desculpe escrever em português, mas como vi que vc é de Brasília..

Meu OJS funcionava perfeitamente em um servidor com uma versão anterior do PHP(não me lembro qual) e agora migrei tudo para um servidor com PHP 5.3.6 através de um sistema de transferência existente no WHM/CPanel - Transferência entre servidores - (parece ser o mesmo problema que gerou este post) e tudo que vejo qdo abro o sistema é uma página em branco sem nenhum erro e nenhum erro é gravado no error_log que esta em minha conta de hospedagem.
Já tentei todas as orientações sugeridas aqui neste post e nenhuma surtiu efeito.

Rapaz, agradeceria demais se você me desse alguma luz além do que já foi dito aqui no post: www.fara.edu.br/sipe.

[]s
Ed Mendonça
Goiânia/Go - Brazil
edmendel
 
Posts: 1
Joined: Mon Jul 16, 2012 7:15 pm

Re: OJS, PHP 5.3.6 and Blank Pages

Postby ramon » Tue Jul 17, 2012 11:40 am

Prezado Ed Mendonça,

Versões anteriores do OJS até a 2.2.4 não funcionam em versões PHP superiores à 5.3.
Já versões do OJS 2.3.x funcionam em versões anteriores do PHP.

Agora, seu problema não parece ser apenas este.
Algum problema de configuração de permissão no servidor está bloqueando o acesso.

Verifique o DNS, proxy, firewall, configurações (usuário do apache e dono da pasta) e logs (erro e acesso) do apache (sites-enabled/available), configurações e logs do PHP para verificar por quê está emitindo a mensagem de Forbidden:
Code: Select all
Forbidden

You don't have permission to access /sipe/ on this server.

Additionally, a 404 Not Found error was encountered while trying to use an ErrorDocument to handle the request.
Apache/2.2.22 (Unix) mod_ssl/2.2.22 OpenSSL/0.9.8e-fips-rhel5 mod_auth_passthrough/2.1 mod_bwlimited/1.4 FrontPage/5.0.2.2635 mod_perl/2.0.6 Perl/v5.8.8 Server at www.fara.edu.br Port 80


_______________________________
Ramón Martins Sodoma da Fonseca
Analista em C&T
Coordenação de Tecnologias de Informação
Instituto Brasileiro de Informação em Ciência e Tecnologia - IBICT
Ministério da Ciência e Tecnologia - MCT
ramon
 
Posts: 931
Joined: Wed Oct 15, 2003 6:15 am
Location: Brasí­lia/DF - Brasil

Re: OJS, PHP 5.3.6 and Blank Pages

Postby blstzus » Tue Jul 17, 2012 6:48 pm

Hi Ramon,
I tried your suggestion. I end up getting new errors:
Code: Select all
[Wed Jul 18 09:21:45 2012] [error] [client 127.0.0.1] PHP Deprecated:  Assigning the return value of new by reference is deprecated in /var/www/journal/classes/core/Core.inc.php on line 52
[Wed Jul 18 09:21:45 2012] [error] [client 127.0.0.1] PHP Deprecated:  Assigning the return value of new by reference is deprecated in /var/www/journal/classes/core/Core.inc.php on line 56
[Wed Jul 18 09:21:45 2012] [error] [client 127.0.0.1] PHP Deprecated:  Assigning the return value of new by reference is deprecated in /var/www/journal/classes/core/Handler.inc.php on line 122
[Wed Jul 18 09:21:45 2012] [error] [client 127.0.0.1] PHP Deprecated:  Assigning the return value of new by reference is deprecated in /var/www/journal/classes/core/Handler.inc.php on line 123
[Wed Jul 18 09:21:45 2012] [error] [client 127.0.0.1] PHP Deprecated:  Assigning the return value of new by reference is deprecated in /var/www/journal/classes/core/ArrayItemIterator.inc.php on line 181
[Wed Jul 18 09:21:45 2012] [error] [client 127.0.0.1] PHP Deprecated:  Assigning the return value of new by reference is deprecated in /var/www/journal/classes/db/DAOResultFactory.inc.php on line 166
[Wed Jul 18 09:21:45 2012] [error] [client 127.0.0.1] PHP Deprecated:  Assigning the return value of new by reference is deprecated in /var/www/journal/classes/db/XMLDAO.inc.php on line 32
[Wed Jul 18 09:21:45 2012] [error] [client 127.0.0.1] PHP Deprecated:  Assigning the return value of new by reference is deprecated in /var/www/journal/classes/db/XMLDAO.inc.php on line 44
[Wed Jul 18 09:21:45 2012] [error] [client 127.0.0.1] PHP Deprecated:  Assigning the return value of new by reference is deprecated in /var/www/journal/classes/db/XMLDAO.inc.php on line 56
[Wed Jul 18 09:21:45 2012] [error] [client 127.0.0.1] PHP Deprecated:  Assigning the return value of new by reference is deprecated in /var/www/journal/classes/xml/XMLParser.inc.php on line 57
[Wed Jul 18 09:21:45 2012] [error] [client 127.0.0.1] PHP Deprecated:  Assigning the return value of new by reference is deprecated in /var/www/journal/classes/xml/XMLParserDOMHandler.inc.php on line 47
[Wed Jul 18 09:21:45 2012] [error] [client 127.0.0.1] PHP Deprecated:  Assigning the return value of new by reference is deprecated in /var/www/journal/classes/db/DAORegistry.inc.php on line 64
[Wed Jul 18 09:21:45 2012] [error] [client 127.0.0.1] PHP Deprecated:  Assigning the return value of new by reference is deprecated in /var/www/journal/classes/i18n/Locale.inc.php on line 125
[Wed Jul 18 09:21:45 2012] [error] [client 127.0.0.1] PHP Deprecated:  Assigning the return value of new by reference is deprecated in /var/www/journal/classes/i18n/Locale.inc.php on line 309
[Wed Jul 18 09:21:45 2012] [error] [client 127.0.0.1] PHP Deprecated:  Assigning the return value of new by reference is deprecated in /var/www/journal/classes/i18n/Locale.inc.php on line 385
[Wed Jul 18 09:21:45 2012] [error] [client 127.0.0.1] PHP Deprecated:  Assigning the return value of new by reference is deprecated in /var/www/journal/classes/i18n/Locale.inc.php on line 423
[Wed Jul 18 09:21:45 2012] [error] [client 127.0.0.1] PHP Deprecated:  Assigning the return value of new by reference is deprecated in /var/www/journal/classes/i18n/Locale.inc.php on line 424
[Wed Jul 18 09:21:45 2012] [error] [client 127.0.0.1] PHP Deprecated:  Assigning the return value of new by reference is deprecated in /var/www/journal/classes/i18n/Locale.inc.php on line 435
[Wed Jul 18 09:21:45 2012] [error] [client 127.0.0.1] PHP Deprecated:  Assigning the return value of new by reference is deprecated in /var/www/journal/classes/i18n/Locale.inc.php on line 436
[Wed Jul 18 09:21:45 2012] [error] [client 127.0.0.1] PHP Deprecated:  Assigning the return value of new by reference is deprecated in /var/www/journal/classes/i18n/Locale.inc.php on line 457
[Wed Jul 18 09:21:45 2012] [error] [client 127.0.0.1] PHP Deprecated:  Assigning the return value of new by reference is deprecated in /var/www/journal/classes/i18n/LocaleFile.inc.php on line 131
[Wed Jul 18 09:21:45 2012] [error] [client 127.0.0.1] PHP Fatal error:  Cannot redeclare class Locale in /var/www/journal/classes/i18n/Locale.inc.php on line 43
[Wed Jul 18 09:21:45 2012] [error] [client 127.0.0.1] File does not exist: /var/www/favicon.ico
[Wed Jul 18 09:21:45 2012] [error] [client 127.0.0.1] File does not exist: /var/www/favicon.ico

which I think is about the same as http://pkp.sfu.ca/bugzilla/show_bug.cgi?id=4775


Thank god someone created google translate. I translated your answer in Portugese above.
You said that Earlier OJS to 2.2.4 does not work with PHP 5.3. That might be the issue. :(
My new server set up:
OJS = 2.2.4.0
PHP= 5.3.10-1ubuntu3.2
Apache = 2.2.22 (Ubuntu)
MySQL = 5.5.24

Actually, I am trying to move my journal from a server to another, and wish to upgrade my OJS after that. Can you suggest what I need to do? Should I upgrade my OJS first? Should I downgrade my PHP?

Thank you.
blstzus
 
Posts: 16
Joined: Mon Apr 26, 2010 12:08 am

Re: OJS, PHP 5.3.6 and Blank Pages

Postby ramon » Wed Jul 18, 2012 7:57 am

Hello blstzus,

You won't be able to run OJS 2.2.4 in your new setup, as it doesn't work with PHP 5.3, but you should be able to upgrade it to 2.3.7 without much problem.
The deprecated messages are probably caused because of the incompatibility of OJS 2.2.4 with PHP 5.3.

Always keep a backup of everything before you upgrade.
Then, via command-line run the following commands from within OJS's directory

Code: Select all
php tools/upgrade.php check

Then
Code: Select all
php tools/upgrade.php patch

Then
Code: Select all
php tools/upgrade.php check

Then
Code: Select all
php tools/upgrade.php upgrade


All these should be in ojs2/docs/UPGRADE
_______________________________
Ramón Martins Sodoma da Fonseca
Analista em C&T
Coordenação de Tecnologias de Informação
Instituto Brasileiro de Informação em Ciência e Tecnologia - IBICT
Ministério da Ciência e Tecnologia - MCT
ramon
 
Posts: 931
Joined: Wed Oct 15, 2003 6:15 am
Location: Brasí­lia/DF - Brasil

Re: OJS, PHP 5.3.6 and Blank Pages

Postby blstzus » Thu Jul 19, 2012 5:51 pm

Hi Ramon,
Thank you for your respond. I tried the code you gave, still I have the same error in terminal (deprecated error message).
So I tried using patch file insted. When i run the code, I get this respond:
Code: Select all
patch -p1 < ojs-2.2.4_to_2.3.7.patch
patching file cache/fc-locale-list.php
patching file 'cache/t_compile/%%04^04F^04F6FBD0%%editorialTeamBoard.tpl.php'
Reversed (or previously applied) patch detected!  Assume -R? [n]


What does that mean? What should I do?
Thank you.

-Aiman-
blstzus
 
Posts: 16
Joined: Mon Apr 26, 2010 12:08 am

Re: OJS, PHP 5.3.6 and Blank Pages

Postby ramon » Mon Jul 23, 2012 6:30 am

Hello Aiam,

The deprecated messages are being displayed because it's the old version executing the upgrade.
When successfully completed, you shouldn't see them again.
You need to check your ojs2/config.inc.php file after upgrade, for new parameters and settings, as well as journal settings.

You don't need to patch cache files. They can be removed before upgrading.
As admin, you can clear data and template caches, or you can delete the files manually through the comand-line (DON'T DELETE THE FOLDERS!).
I would run the php tools/upgrade check command again to see what's the situation, to decide if it's best to restore the backup or continue.

If you haven't made any significant changes to OJS, you can also upgrade through the full-download, which may be faster, as all you'll need to do is set the dbase configuration settings in the new ojs2/config.inc.php to access the current database, then execute the dbase upgrade command (php tools/upgrade.php upgrade).

_______________________________
Ramón Martins Sodoma da Fonseca
Analista em C&T
Coordenação de Tecnologias de Informação
Instituto Brasileiro de Informação em Ciência e Tecnologia - IBICT
Ministério da Ciência e Tecnologia - MCT
ramon
 
Posts: 931
Joined: Wed Oct 15, 2003 6:15 am
Location: Brasí­lia/DF - Brasil

Re: OJS, PHP 5.3.6 and Blank Pages

Postby blstzus » Mon Jul 23, 2012 9:39 pm

Hi Ramon,
Thank you for your response.
I have succesfully upgrade to 2.3.7 (with some hunks, mostly in /templates folders).
Now I get new errors:
Code: Select all
[Tue Jul 24 11:48:03 2012] [error] [client 127.0.0.1] PHP Warning:  require(includes/driver.inc.php): failed to open stream: No such file or directory in /var/www/ojs2/index.php on line 97
[Tue Jul 24 11:48:03 2012] [error] [client 127.0.0.1] PHP Fatal error:  require(): Failed opening required 'includes/driver.inc.php' (include_path='.:/var/www/journal/lib/pkp/includes') in /var/www/ojs2/index.php on line 97


Well, yes, upgrading using full download does help. But I have made a few changes on the looks. Might need to change that manually then. :(
Thanks for the help.

-Aiman-
blstzus
 
Posts: 16
Joined: Mon Apr 26, 2010 12:08 am

Re: OJS, PHP 5.3.6 and Blank Pages

Postby ramon » Tue Jul 24, 2012 6:22 am

Hello Aiman,

This new issue may be a permission problem or a server configuration problem, or something else altogether.
First, check if OJS is owned by the Apache user and file/folder permissions are set correctly (check the ojs/docs folder and searching for permission in this forum should help you set these accordingly).
Then, I would look at Github and compare if the local OJS folder has the same files and folder structure as the Github one.

Then, check your server configuration files (either PHP or Apache, depends on your server), to see if the includes directory setting is correct.
Without access to your server it's a bit hard for me to assist you and may be beyond my expertise.
It seems like a file is missing somewhere, or the server can't find the correct path.

Let's hope the PKP team jumps in.
I couldn't find anything related that has a different solution.

_______________________________
Ramón Martins Sodoma da Fonseca
Analista em C&T
Coordenação de Tecnologias de Informação
Instituto Brasileiro de Informação em Ciência e Tecnologia - IBICT
Ministério da Ciência e Tecnologia - MCT
ramon
 
Posts: 931
Joined: Wed Oct 15, 2003 6:15 am
Location: Brasí­lia/DF - Brasil

Re: OJS, PHP 5.3.6 and Blank Pages

Postby blstzus » Wed Jul 25, 2012 10:23 pm

Hi ramon,
Sorry for the late reply.
I actually understand what the problem is with "include/driver.inc.php" error.
When upgrading from 2.2.4 to 2.3.7, the folder include will be deleted.
So, when applying patch to 2.3.7, there is actually a index.php.rej file. Silly me for not realizing that.
So I just apply the patch manually, the error disappear.

My system is almost okay now, but trying to correct all the .rej files.
Will update the progress/problem later. Although I found other problems currently. But not really related to this thread though.
Thank you for the help so far.
Might need help later though :D

Thank you.
-Aiman-
blstzus
 
Posts: 16
Joined: Mon Apr 26, 2010 12:08 am

Re: OJS, PHP 5.3.6 and Blank Pages

Postby blstzus » Sun Jul 29, 2012 5:05 pm

Hi,
Just to update that my server is all okay now.
Thanks for all the help.
This problem helps me understand php etc better. Really happy.

-Aiman-
blstzus
 
Posts: 16
Joined: Mon Apr 26, 2010 12:08 am

Re: OJS, PHP 5.3.6 and Blank Pages

Postby ramon » Mon Jul 30, 2012 6:57 am

Hello Aiman,

Glad to know you're getting the hang of it, and that you've solved your problems!

_______________________________
Ramón Martins Sodoma da Fonseca
Analista em C&T
Coordenação de Tecnologias de Informação
Instituto Brasileiro de Informação em Ciência e Tecnologia - IBICT
Ministério da Ciência e Tecnologia - MCT
ramon
 
Posts: 931
Joined: Wed Oct 15, 2003 6:15 am
Location: Brasí­lia/DF - Brasil

Re: OJS, PHP 5.3.6 and Blank Pages

Postby atoz » Sun Mar 17, 2013 9:34 pm

asmecher wrote:Hi acardh,

Glad to hear you've solved the problem -- but watch out for those 777 permissions; they're very likely a security risk. The best way to set this up varies from system to system, but the main thing you have to figure out is which user account PHP uses to try to upload files. Try uploading a file through PHP in your current setup, and see what user the file belongs to. It'll likely be "www-data" or similar. Then use chown -R to set the same owner for recursively in your "public" and "cache" directories (and anything else you set 777), and use chmod -R to drop the permissions down to 755 (or even lower -- 700 should work too).

Regards,
Alec Smecher
Public Knowledge Project Team

Hi Alec,

I have a similiar problem. At the host, I have an especific user that files belongs to, i.e. called "myuser".
All my folders has this owner "myuser:myuser". If a try to use the system with 755, I can't access some pages. On apache's log I'm getting a permission error with t_compile.
If a set t_compile to 777, the system is starting to work fine. As I can see, on this situation the files inside t_compile have another owner, the www-data.

I've tried to start again with a new "cache" folder with 755 permissions and the original owner (myuser:myuser) but it doesn't work at all.

As I can see in your message, it is not really a safe procedure to use 777 even in these folders like cache and public.

Do you have any idea to solve this problem?

Eduardo
Universidade Federal do Paraná
atoz
 
Posts: 4
Joined: Sun Mar 17, 2013 9:04 pm

Re: OJS, PHP 5.3.6 and Blank Pages

Postby ramon » Mon Mar 18, 2013 6:49 am

Hello atoz,

When you are logged in the server, your user has to be the owner of the files so you can edit them.
However, Apache is running as a different user and that user needs permission on your folders.
You can run chown -Rf www-data:youruser to OJS folder (this will run recursively!) so that Apache has permission and your group also has permission.
You could also try playing with permissions (adding the apache user only on certain folders), but usually that takes a lot of work and may later cause you further issues.

_______________________________
Ramón Martins Sodoma da Fonseca
Analista em C&T
Coordenação de Tecnologias de Informação
Instituto Brasileiro de Informação em Ciência e Tecnologia - IBICT
Ministério da Ciência e Tecnologia - MCT
ramon
 
Posts: 931
Joined: Wed Oct 15, 2003 6:15 am
Location: Brasí­lia/DF - Brasil

PreviousNext

Return to OJS Technical Support

Who is online

Users browsing this forum: No registered users and 2 guests