Skip to content

Unexpected error #25

Closed
Closed

Description

@GDLaw

Travis,

I am running into a problem with my site (no worries - it's still in development) but, the problem I ran into started happening when I created an add-on domain. I needed to do this with my provider so I could specify the root directory of the site to be the public directory of laravel.

Anyway, after this configuration took place I started getting this error:

Symfony \ Component \ Debug \ Exception \ FatalErrorException
syntax error, unexpected '['

Referencing this file:

Symfony\Component\Debug\Exception\FatalErrorException
…/­vendor/­codesleeve/­stapler/­src/­Codesleeve/­Stapler/­StaplerServiceProvider.php line:118

I thought it might be a problem with the class not resolving correctly so I tries to update the class files with composer using composer update and during the update I received this error:

Generating autoload files
{"error":{"type":"Symfony\Component\Debug\Exception\FatalErrorException","message":"syntax error, unexpected '['","file":"/home/damascu1/drccweb/vendor/codesleeve/stapler/src/Codesleeve/Stapler/StaplerServiceProvider.php","line":118}}{"error":{"type":"Symfony\Component\Debug\Exception\FatalErrorException","message":"syntax error, unexpected '['","file":"/home/damascu1/drccweb/vendor/codesleeve/stapler/src/Codesleeve/Stapler/StaplerServiceProvider.php","line":118}}Script php artisan clear-compiled handling the post-update-cmd event returned with an error

any advice?

Activity

  1. GDLaw commented on Jan 21, 2014

    @GDLaw
    Author

    Also Travis - you can see the error by going to http://drccweb.org

  2. tabennett commented on Jan 21, 2014

    @tabennett
    Contributor

    I don't see an error when I go to that site.

  3. GDLaw commented on Jan 21, 2014

    @GDLaw
    Author

    OK - disregard this issue Travis. This problem is resolved when I remove the add-on domain.

    I'm still lost as to how to configure this site correctly though. Here's my problem:

    My hosting provider - A2hosting - will only support shared domains with the document root pointing to the public_html directory. ------ home/username/public_html ----

    however my laravel document root is located at: ---- home/username/laravel/public ----

    here is the tree structure:

    home
    /username
    /laravel
    /public
    /public_html

    I can get the site to resolve correctly by copying the files in my laravel/public directory to the public_html directory and changing the routes in the index.php file to point to the autoload.php and start.php files in the bootstrap directory (shown below).

    index.php file:-----------------------------------------------------------------------
    require DIR.'/../laravel/bootstrap/autoload.php';

    $app = require_once DIR.'/../laravel/bootstrap/start.php';

    Then in the paths.php file in the bootstrap directory I change the route to the public directory to point to the public_html directory.

    ppaths.php file: --------------------------------------------------------------------

    'public' => DIR.'/../../public_html',


    The site renders fine now but, when I store an image with stapler it puts the files into the laravel/public directory instead of the public_html directory. Is there a way to tell stapler that the document root is now public_html?

    Sorry for the long explanation Travis. I know this is not your issue, your app works really great. It's just trying to get around the configuration of a shared hosting environment.

    Thanks again,
    Glen

  4. GDLaw commented on Jan 21, 2014

    @GDLaw
    Author

    Well - in the filesystem.php file I modified the path variable from this:

    'path' => ':laravel_root/public:url',

    to this:

    'path' => ':laravel_root/../public_html:url',

    It seems to be working fine now. I hope this was the answer!!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions