algorys / gitlabproject

Dokuwiki plugin to display a Gitlab project
3 stars 4 forks source link

PHP error after install #3

Closed stefanoco closed 6 years ago

stefanoco commented 6 years ago

After installing with the admin extension manager any following page rendering gives an error in the Apache2 log (and no page shown):

$ sudo tail /var/log/apache2/error.log
[Mon Oct 16 15:13:46 2017] [error] [client x.x.x.x] PHP Parse error:  syntax error, unexpected '[' in /var/path_to_dokuwiki/lib/plugins/gitlabproject/syntax.php on line 166, referer: http://URI_to_dokuwiki/doku.php?id=start

How to reproduce:

algorys commented 6 years ago

@stefanoco Wow, I think I was tired when I wrote this code. I'll fix ASAP.

algorys commented 6 years ago

Done.

stefanoco commented 6 years ago

Thanks a lot. Unfortunately I'm not proficient enough in PHP to spot the issue and solution by myself!

stefanoco commented 6 years ago

Again unfortunatly, this time on line 52 of gitlab.php

algorys commented 6 years ago

@stefanoco please provide me the error.

Which version of PHP do you use ?

stefanoco commented 6 years ago

pretty old indeed:

$ php -r \phpinfo\(\)\; | grep 'PHP Version'
PHP Version => 5.3.10-1ubuntu3.26
PHP Version => 5.3.10-1ubuntu3.26
[Mon Oct 16 19:40:18 2017] [error] [client x.x.x.x] PHP Parse error:  syntax error, unexpected '[' in /var/path_to_dokuwiki/lib/plugins/gitlabproject/gitlab/gitlab.php on line 52, referer: http://URI_to_dokuwiki/doku.php?id=start
algorys commented 6 years ago

Ok, you can't upgrade to a newest version ? I'm in PHP 5.6 and there is no error for me.

algorys commented 6 years ago

@stefanoco Normally fixed by last version.

stefanoco commented 6 years ago

Ok I see that this is a requirement for Dokuwiki itself indeed, I'll upgrade for sure

algorys commented 6 years ago

@stefanoco plugin works for you now ?

stefanoco commented 6 years ago

Fine thanks works now with my old PHP also... I will upgrade in any case.

hAh0L13 commented 5 years ago

Hello. I have similar problem. After clean install throuhgt Extension Manager and configuring in Settings page, I had try to use plugin with correct syntax - but got blank page w/o dokuwiki side links (edit, move, up and other). Apache error.log have this:

[Thu Oct 04 16:07:07.171219 2018] [php7:error] [pid 24885] [client IP_client] PHP Fatal error: Uncaught Error: Call to undefined function curl_init() in /var/www/dokuwiki/lib/plugins/gitlabproject/gitlab/gitlab.php:13\nStack trace:\n#0 /var/www/dokuwiki/lib/plugins/gitlabproject/syntax.php(104): DokuwikiGitlab->__construct(Array)\n#1 /var/www/dokuwiki/lib/plugins/gitlabproject/syntax.php(91): syntax_plugin_gitlabproject->renderGitlab(Object(Doku_Renderer_xhtml), Array)\n#2 /var/www/dokuwiki/inc/parser/renderer.php(111): syntax_plugin_gitlabproject->render('xhtml', Object(Doku_Renderer_xhtml), Array)\n#3 /var/www/dokuwiki/inc/parserutils.php(654): Doku_Renderer->plugin('gitlabproject', Array, 5, '<gitlab project...')\n#4 /var/www/dokuwiki/inc/parserutils.php(130): p_render('xhtml', Array, NULL)\n#5 /var/www/dokuwiki/inc/parserutils.php(83): p_cached_output('/var/www/dokuwi...', 'xhtml', 'python_scripts:...')\n#6 /var/www/dokuwiki/inc/html.php(293): p_wiki_xhtml('python_scripts:...', 0, true, '')\n#7 /var/www/dokuwiki/inc/Action/Show.php(33): html_show()\n#8 /var/www/dokuwiki/inc/template.php(98): dokuwiki\\Action\\ in /var/www/dokuwiki/lib/plugins/gitlabproject/gitlab/gitlab.php on line 13, referer: http://IP_dokuwiki/doku.php?id=python_scripts:urg_get_ftp

DokuWiki Release 2018-04-22a "Greebo" PHP Version => 7.2.10-0ubuntu0.18.04.1

Another mistake - changing settings throught web page does not affect server.json file and conf/default.php, i'm edit this files manually