Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

getting this error while installing pimcore 5 on ampps as well as on wamp in windows #1454

Closed
amjadniazi48 opened this issue Apr 23, 2017 · 12 comments
Labels
Milestone

Comments

@amjadniazi48
Copy link

Bug Report

Uncaught Symfony\Component\Debug\Exception\FatalThrowableError: Type error: Argument 1 passed to Pimcore\Templating\Renderer\ActionRenderer::createDocumentReference() must be an instance of Pimcore\Model\Document\PageSnippet, null given, called in D:\Ampps\www\pimcore\lib\Pimcore\Bundle\CoreBundle\EventListener\ResponseExceptionListener.php on line 106 in D:\Ampps\www\pimcore\lib\Pimcore\Templating\Renderer\ActionRenderer.php:95 Stack trace: #0 D:\Ampps\www\pimcore\lib\Pimcore\Bundle\CoreBundle\EventListener\ResponseExceptionListener.php(106): Pimcore\Templating\Renderer\ActionRenderer->createDocumentReference(NULL) #1 D:\Ampps\www\pimcore\lib\Pimcore\Bundle\CoreBundle\EventListener\ResponseExceptionListener.php(77): Pimcore\Bundle\CoreBundle\EventListener\ResponseExceptionListener->handleErrorPage(Object(Symfony\Component\HttpKernel\Event\GetResponseForExceptionEvent)) #2 [internal function]: Pimcore\Bundle\CoreBundle\EventListener\ResponseExceptionListener->onKernelException(Object(Symfony\Component\HttpKer in D:\Ampps\www\pimcore\lib\Pimcore\Templating\Renderer\ActionRenderer.php on line 95

Feature description

@brusch brusch added the Bug label Apr 27, 2017
@brusch brusch added this to the 5.0.0 milestone Apr 27, 2017
@s15h
Copy link

s15h commented May 4, 2017

I am experiencing the same problem with the LEMP stack with the default symfony nginx configuration.
Nginx config:

server {
    listen 80;
    server_name core.dev www.core.dev;
    root /var/www/core.dev/web;
    include mime.types;

    location / {
        # try to serve file directly, fallback to app.php
        try_files $uri /app.php$is_args$args;
    }

    location ~ ^/app\.php(/|$) {
        fastcgi_pass php:9000;
        fastcgi_split_path_info ^(.+\.php)(/.*)$;
        include fastcgi_params;
        # When you are using symlinks to link the document root to the
        # current version of your application, you should pass the real
        # application path instead of the path to the symlink to PHP
        # FPM.
        # Otherwise, PHP's OPcache may not properly detect changes to
        # your PHP files (see https://github.com/zendtech/ZendOptimizerPlus/issues/126
        # for more information).
        fastcgi_param SCRIPT_FILENAME $realpath_root$fastcgi_script_name;
        fastcgi_param DOCUMENT_ROOT $realpath_root;
        # Prevents URIs that include the front controller. This will 404:
        # http://domain.tld/app.php/some-path
        # Remove the internal directive to allow URIs like this
    }

    # return 404 for all other php files not matching the front controller
    # this prevents access to other php files you don't want to be accessible.
    location ~ \.php$ {
        return 404;
    }

    error_log /var/log/nginx/core_error.log;
    access_log /var/log/nginx/core_acces.log;
}

@s15h
Copy link

s15h commented May 5, 2017

This problem went away for me after installing. Though this meant I could not check requirements before install.

@bbak
Copy link
Contributor

bbak commented May 5, 2017

Ran into this also yesterday. Requirements check is not possible before having run the installer (IMHO due to missing file app/config/parameters.yml - but I'm not sure)

Besides that, I've these additional Blocks in my nginx config:

	# Pimcore Head-Link Cache-Busting
	rewrite ^/cache-buster-(?:\d+)/(.*) /$1 last;

	# Thumbnails
	location ~* .*/(image|video)-thumb__\d+__.* {
		try_files /var/tmp/$1-thumbnails$request_uri /app.php;
		expires 1d;
		access_log off;
		add_header Cache-Control "public";
	}

	# Pimcore Assets
	# Still use a whitelist approach to prevent each and every missing asset to go through the PHP Engine.
	location ~* (.+?)\.((?:css|js)(?:\.map)?|jpe?g|gif|png|svgz?|eps|exe|gz|zip|mp\d|ogg|ogv|webm|pdf|docx?|xlsx?|pptx?)$ {
		try_files /var/assets$uri $uri =404;
		expires 1d;
		access_log off;
		add_header Cache-Control "public";
	}
	# don't allow PHP in folders allowing file uploads
	location ~* /var/assets/*\.php(/|$) {
		return 404;
	}

Note: They don't handle WEBDAV and in contrast to the Apache-Config for v5, I explicitly catch file extensions for assets in a location that doesn't rewrite to /app.php - I simply don't want a 404 of an GET Request to a Asset to fire up a PHP Process.

@s15h
Copy link

s15h commented May 5, 2017

Thanks for that I'm definitely adding those blocks to my config.

@amjadniazi48
Copy link
Author

amjadniazi48 commented May 5, 2017

i can install symfony 3 , magento 2, yii2,drupal 8 on my localhost but i cannot install pimcore 5 even after 15 days , i have used docker as well but failed. please make pimcore installation process simple and make the installation documentation easy for new comer if you want more php community on pimcore.

@brusch
Copy link
Member

brusch commented May 8, 2017

@amjadniazi48 when exaclty you get the error message above? When opening the installer? (http://host/install.php) A bit more details would be really helpful ...

@brusch
Copy link
Member

brusch commented May 8, 2017

Btw. Pimcore 5 is in alpha and isn't tested well on platforms other than LAMP, so any help to improve support on Windows, Nginx, ... is highly appreciated.

@brusch
Copy link
Member

brusch commented May 8, 2017

@bbak would be nice if you could contribute your Nginx config :)
https://www.pimcore.org/docs/5.0.0/Installation_and_Upgrade/System_Setup_and_Hosting/Nginx_Configuration.html

@bbak
Copy link
Contributor

bbak commented May 8, 2017

@brusch Sure. Just give me some more time to be a bit more confident it actually works. ;-)

@amjadniazi48
Copy link
Author

amjadniazi48 commented May 8, 2017

@brusch i m trying to install the pimcore 5 with the following composer command
composer create-project -s dev pimcore/pimcore ./your-project-name dev-master
on wamp but it shows me error as i mentioned above when i go to check installation requirements.
It shows following error after
(http://host/install.php) installtion
Fatal error: Cannot use Pimcore\Model\User as User because the name is already in use in C:\wamp64\www\pimcore5\pimcore\lib\Pimcore\Bundle\AdminBundle\Security\User\TokenStorageUserResolver.php on line 18

@amjadniazi48
Copy link
Author

amjadniazi48 commented May 14, 2017

I have successfully installed it on ampps, but the sidebar panel with assets, objects and documents cannot load completely
shows these sort of errors in popup
Status: 0 URL: /admin/object/tree-get-root Message:

Status: 0 | URL: /admin/portal/dashboard-list Message:

Status: 0 URL: /admin/document/tree-get-root Message: Status: 0
URL: /admin/asset/tree-get-root
Message:
Status: 0 | communication failure URL: /admin/document/doc-types?xaction=read&_dc=1494762867249 Method: GET Message: undefined
Status: 0 | communication failure URL: /admin/reports/targeting/persona-list?_dc=1494762866979 Method: GET Message: undefined
Status: 0 | communication failure URL: /admin/settings/get-available-sites?_dc=1494762866972 Method: GET Message: undefined

Status: 0 | communication failure URL: /admin/settings/get-available-admin-languages?_dc=1494762866962 Method: GET Message: undefined
Status: 0 | communication failure URL: /admin/class/get-tree?createAllowed=true&_dc=1494762866955 Method: GET Message: undefined
Status: 0 | communication failure URL: /admin/class/get-tree?_dc=1494762866943 Method: GET Message: undefined

@fashxp
Copy link
Member

fashxp commented Sep 20, 2017

tested on default xampp stack on windows with basic-demo profile. install and pimcore work so far, created following detail issues:
#2003
#2002

can you please test the latest build of pimcore5 and report issues if some occur. thank you.

@fashxp fashxp closed this as completed Sep 20, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

5 participants