jumilla / wordpress-plus

Laravel 5 feat. WordPress. Use Lumen.
64 stars 19 forks source link

Error after installation with composer #3

Open dcnl1980 opened 9 years ago

dcnl1980 commented 9 years ago

Fatal error: Arrays are not allowed in class constants in /srv/www/laravel_plus/app/Http/Controllers/WordPress/TemplateController.php on line 32

Fatal error: Uncaught exception 'BadMethodCallException' with message 'Method [send] does not exist on view.' in /srv/www/laravel_plus/vendor/illuminate/view/View.php:380 Stack trace: #0 /srv/www/laravel_plus/vendor/laravel/lumen-framework/src/Application.php(408): Illuminate\View\View->__call('send', Array) #1 /srv/www/laravel_plus/vendor/laravel/lumen-framework/src/Application.php(408): Illuminate\View\View->send() #2 /srv/www/laravel_plus/vendor/laravel/lumen-framework/src/Application.php(348): Laravel\Lumen\Application->handleUncaughtException(Object(Symfony\Component\Debug\Exception\FatalErrorException)) #3 [internal function]: Laravel\Lumen\Application->Laravel\Lumen{closure}() #4 {main} thrown in /srv/www/laravel_plus/vendor/illuminate/view/View.php on line 380

jumilla commented 9 years ago

What is PHP version?

dcnl1980 commented 9 years ago

PHP 5.5.9-1ubuntu4.13

jumilla commented 9 years ago

readme says:

WordPress+ requires PHP more than 5.6 (for a Lumen framework, more than 5.5.9).

dcnl1980 commented 9 years ago

Yes, that did the trick. So for Ubuntu users to upgrade to php 5.6, do the following:

One thing, how to put English as main-language?

dcnl1980 commented 9 years ago

After I delete the wp-config.php, the root is redirecting to http://plus.2srv.nl/wp-admin/setup-config.php, but we get a 404 error.

jumilla commented 9 years ago

Is PHP version of the problem is solved?

Please do not delete wp-config.php.

Database setting on the .env file, because In order to share and settings lumen applications.

jumilla commented 9 years ago

the root is redirecting to http://plus.2srv.nl/wp-admin/setup-config.php, but we get a 404 error.

I made issue #4.

jumilla commented 9 years ago

After database setting, you can open http://plus.2srv.nl/wp-admin/.

dcnl1980 commented 9 years ago

Yes PHP version is PHP 5.6.14-1+deb.sury.org~trusty+1 (cli)

dcnl1980 commented 9 years ago

The above link is redirecting to: http://plus.2srv.nl/wp-admin/upgrade.php?_wp_http_referer=%2Fwp-admin%2F

dcnl1980 commented 9 years ago

And ending with 404

jumilla commented 9 years ago

Yes PHP version is PHP 5.6.14-1+deb.sury.org~trusty+1 (cli)

Thank you!

jumilla commented 9 years ago

The above link is redirecting to: http://plus.2srv.nl/wp-admin/upgrade.php?_wp_http_referer=%2Fwp-admin%2F

Umm... We take a look that.

jumilla commented 9 years ago

@dcnl1980 I think there is cause to httpd.conf or public/.htaccess.

the execution of the .php file must be only public/index.php because all url needs through Lumen routing.

It shows an example of nginx configration.

server {
    listen              80;
    server_name     codeforoedo.org;

    root                /.../public;

    client_max_body_size            30M;
    set                             $php_value "post_max_size=30M";
    set                             $php_value "$php_value \n upload_max_filesize=30M";

    types {
        text/html                   php;
    }

    location / {
        index                   index.php;

        try_files $uri $uri/ /index.php$is_args$args;
    }

    location ~ ^/index\.php$ {
        try_files       $uri =404;

        fastcgi_pass    unix:/var/run/php-fpm/www.sock;

        include         fastcgi_params;
        fastcgi_index   index.php;
        fastcgi_param   SCRIPT_FILENAME $document_root$fastcgi_script_name;
        fastcgi_param   PHP_VALUE $php_value;
    }

    access_log          /.../logs/nginx-access.log;
    error_log           /.../logs/nginx-error.log;
}
jumilla commented 8 years ago

@dcnl1980 We released v1.1.0.

Add example for Apache configuration, and change public/.htaccess. Please re-install & read readme.

Thanks!

ghost commented 8 years ago

@dcnl1980 i have exatly the same error with php 5.5.9 after upgrading to php 5.6.17 i get this error

[2016-01-23 23:08:13] lumen.ERROR: exception 'Symfony\Component\Debug\Exception\FatalErrorException' with message 'Arrays are not allowed in class constants' in /home/admin/web/showtracker.me/public_html/app/Http/Controllers/WordPress/TemplateController.php:32
Stack trace:
#0 [internal function]: Laravel\Lumen\Application->Laravel\Lumen\{closure}()
#1 {main}  

edit: LoL fixed after sudo service apache2 restart :p