Hello,

Please help me set this laravel framework file.

I have two folders:

framework_freshway:

  • public_html
  • framework

I still receive this error message when trying to run this url:

http://localhost/framework_freshway/public_html/

Parse error: syntax error, unexpected 'class' (T_CLASS), expecting identifier (T_STRING) or variable (T_VARIABLE) or '{' or '$' in C:\Program Files (x86)\EasyPHP-DevServer-14.1VC9\data\localweb\framework_freshway\public_html\index.php on line 50

public_html

<?php

/**
 * Laravel - A PHP Framework For Web Artisans
 *
 * @package  Laravel
 * @author   Taylor Otwell <taylorotwell@gmail.com>
 */

/*
|--------------------------------------------------------------------------
| Register The Auto Loader
|--------------------------------------------------------------------------
|
| Composer provides a convenient, automatically generated class loader for
| our application. We just need to utilize it! We'll simply require it
| into the script here so that we don't have to worry about manual
| loading any of our classes later on. It feels nice to relax.
|
*/

require __DIR__.'/../framework/bootstrap/autoload.php';

/*
|--------------------------------------------------------------------------
| Turn On The Lights
|--------------------------------------------------------------------------
|
| We need to illuminate PHP development, so let us turn on the lights.
| This bootstraps the framework and gets it ready for use, then it
| will load up this application so that we can run it and send
| the responses back to the browser and delight our users.
|
*/

$app = require_once __DIR__.'/../framework/bootstrap/app.php';

/*
|--------------------------------------------------------------------------
| Run The Application
|--------------------------------------------------------------------------
|
| Once we have the application, we can handle the incoming request
| through the kernel, and send the associated response back to
| the client's browser allowing them to enjoy the creative
| and wonderful application we have prepared for them.
|
*/

$kernel = $app->make(Illuminate\Contracts\Http\Kernel::class);

$response = $kernel->handle(
    $request = Illuminate\Http\Request::capture()
);

$response->send();

$kernel->terminate($request, $response);

Line 50: $kernel = $app->make(Illuminate\Contracts\Http\Kernel::class);

Recommended Answers

All 7 Replies

Member Avatar for diafol

You need last php5.6.* or php7 not the one you have. This has been explained twice already.

Member Avatar for diafol

Alternatively you could try a previous version of laravel

I try Xampp and I get this error message:

  1/1 PDOException in Connector.php line 50: SQLSTATE[HY000] [2002]     No connection could be made because the target machine actively refused it.

 in Connector.php line 50
 at PDO->__construct('mysql:host=soulfy.com;dbname=wwwsoulf_revsoul',  'wwwsoulf_revsoul', 'deleted', array('0', '2', '0', false, false)) in Connector.php line 50
 at Connector->createConnection('mysql:host=soulfy.com;    dbname=wwwsoulf_revsoul', array('driver' => 'mysql', 'host' => 'soulfy.com', 'database' => 'wwwsoulf_revsoul', 'username' => 'wwwsoulf_revsoul', 'password' => 'deleted', 'charset' => 'utf8', 'collation' => 'utf8_unicode_ci', 'prefix' => '', 'strict' => false, 'name' => 'mysql'), array('0', '2', '0', false, false)) in MySqlConnector.php line 22
   at MySqlConnector->connect(array('driver' => 'mysql', 'host' => 'soulfy.com', 'database' => 'wwwsoulf_revsoul', 'username' => 'wwwsoulf_revsoul', 'password' => 'deleted', 'charset' => 'utf8', 'collation' => 'utf8_unicode_ci', 'prefix' => '', 'strict' => false, 'name' => 'mysql')) in ConnectionFactory.php line 60
    at ConnectionFactory->createSingleConnection(array('driver' => 'mysql', 'host' => 'soulfy.com', 'database' => 'wwwsoulf_revsoul', 'username' => 'wwwsoulf_revsoul', 'password' => 'deleted', 'charset' => 'utf8', 'collation' => 'utf8_unicode_ci', 'prefix' => '', 'strict' => false, 'name' => 'mysql')) in ConnectionFactory.php line 49
    at ConnectionFactory->make(array('driver' => 'mysql', 'host' => 'soulfy.com', 'database' => 'wwwsoulf_revsoul', 'username' => 'wwwsoulf_revsoul', 'password' => 'deleted', 'charset' => 'utf8', 'collation' => 'utf8_unicode_ci', 'prefix' => '', 'strict' => false, 'name' => 'mysql'), 'mysql') in DatabaseManager.php line 175
    at DatabaseManager->makeConnection('mysql') in DatabaseManager.php line 67
    at DatabaseManager->connection('mysql') in Model.php line 3152
    at Model::resolveConnection(null) in Model.php line 3118
    at Model->getConnection() in Model.php line 1866
    at Model->newBaseQueryBuilder() in Model.php line 1809
    at Model->newQueryWithoutScopes() in Model.php line 1783
    at Model->newQuery() in Model.php line 3364
    at Model->__call('where', array('domain', 'localhost'))
    at call_user_func_array(array(object(User), 'where'), array('domain', 'localhost')) in Model.php line 3380
    at Model::__callStatic('where', array('domain', 'localhost')) in HomeController.php line 323
    at HomeController->getHome()
    at call_user_func_array(array(object(HomeController), 'getHome'), array()) in Controller.php line 256
    at Controller->callAction('getHome', array()) in ControllerDispatcher.php line 164
    at ControllerDispatcher->call(object(HomeController), object(Route), 'getHome') in ControllerDispatcher.php line 112
    at ControllerDispatcher->Illuminate\Routing\{closure}(object(Request))
    at call_user_func(object(Closure), object(Request)) in Pipeline.php line 139
    at Pipeline->Illuminate\Pipeline\{closure}(object(Request))
    at call_user_func(object(Closure), object(Request)) in Pipeline.php line 102
    at Pipeline->then(object(Closure)) in ControllerDispatcher.php line 114
    at ControllerDispatcher->callWithinStack(object(HomeController), object(Route), object(Request), 'getHome') in ControllerDispatcher.php line 67
    at ControllerDispatcher->dispatch(object(Route), object(Request), 'Soulfy\Http\Controllers\HomeController', 'getHome') in Route.php line 201
    at Route->runWithCustomDispatcher(object(Request)) in Route.php line 134
    at Route->run(object(Request)) in Router.php line 704
    at Router->Illuminate\Routing\{closure}(object(Request))
    at call_user_func(object(Closure), object(Request)) in Pipeline.php line 139
    at Pipeline->Illuminate\Pipeline\{closure}(object(Request))
    at call_user_func(object(Closure), object(Request)) in Pipeline.php line 102
    at Pipeline->then(object(Closure)) in Router.php line 706
    at Router->runRouteWithinStack(object(Route), object(Request)) in Router.php line 669
    at Router->dispatchToRoute(object(Request)) in Router.php line 631
    at Router->dispatch(object(Request)) in Kernel.php line 237
    at Kernel->Illuminate\Foundation\Http\{closure}(object(Request))
    at call_user_func(object(Closure), object(Request)) in Pipeline.php line 139
    at Pipeline->Illuminate\Pipeline\{closure}(object(Request)) in VerifyCsrfToken.php line 50
    at VerifyCsrfToken->handle(object(Request), object(Closure))
    at call_user_func_array(array(object(VerifyCsrfToken), 'handle'), array(object(Request), object(Closure))) in Pipeline.php line 124
    at Pipeline->Illuminate\Pipeline\{closure}(object(Request)) in ShareErrorsFromSession.php line 54
    at ShareErrorsFromSession->handle(object(Request), object(Closure))
    at call_user_func_array(array(object(ShareErrorsFromSession), 'handle'), array(object(Request), object(Closure))) in Pipeline.php line 124
    at Pipeline->Illuminate\Pipeline\{closure}(object(Request)) in StartSession.php line 62
    at StartSession->handle(object(Request), object(Closure))
    at call_user_func_array(array(object(StartSession), 'handle'), array(object(Request), object(Closure))) in Pipeline.php line 124
    at Pipeline->Illuminate\Pipeline\{closure}(object(Request)) in AddQueuedCookiesToResponse.php line 37
    at AddQueuedCookiesToResponse->handle(object(Request), object(Closure))
    at call_user_func_array(array(object(AddQueuedCookiesToResponse), 'handle'), array(object(Request), object(Closure))) in Pipeline.php line 124
    at Pipeline->Illuminate\Pipeline\{closure}(object(Request)) in EncryptCookies.php line 59
    at EncryptCookies->handle(object(Request), object(Closure))
    at call_user_func_array(array(object(EncryptCookies), 'handle'), array(object(Request), object(Closure))) in Pipeline.php line 124
    at Pipeline->Illuminate\Pipeline\{closure}(object(Request)) in CheckForMaintenanceMode.php line 42
    at CheckForMaintenanceMode->handle(object(Request), object(Closure))
    at call_user_func_array(array(object(CheckForMaintenanceMode), 'handle'), array(object(Request), object(Closure))) in Pipeline.php line 124
    at Pipeline->Illuminate\Pipeline\{closure}(object(Request))
    at call_user_func(object(Closure), object(Request)) in Pipeline.php line 102
    at Pipeline->then(object(Closure)) in Kernel.php line 123
    at Kernel->sendRequestThroughRouter(object(Request)) in Kernel.php line 88
    at Kernel->handle(object(Request)) in index.php line 53

soulfy_public_html/public_html/index.php

 <?php

/**
 * Laravel - A PHP Framework For Web Artisans
 *
 * @package  Laravel
 * @author   Taylor Otwell <taylorotwell@gmail.com>
 */

/*
|--------------------------------------------------------------------------
| Register The Auto Loader
|--------------------------------------------------------------------------
|
| Composer provides a convenient, automatically generated class loader for
| our application. We just need to utilize it! We'll simply require it
| into the script here so that we don't have to worry about manual
| loading any of our classes later on. It feels nice to relax.
|
*/

require __DIR__.'/../soulfy_framework/bootstrap/autoload.php';

/*
|--------------------------------------------------------------------------
| Turn On The Lights
|--------------------------------------------------------------------------
|
| We need to illuminate PHP development, so let us turn on the lights.
| This bootstraps the framework and gets it ready for use, then it
| will load up this application so that we can run it and send
| the responses back to the browser and delight our users.
|
*/

$app = require_once __DIR__.'/../soulfy_framework/bootstrap/app.php';

/*
|--------------------------------------------------------------------------
| Run The Application
|--------------------------------------------------------------------------
|
| Once we have the application, we can handle the incoming request
| through the kernel, and send the associated response back to
| the client's browser allowing them to enjoy the creative
| and wonderful application we have prepared for them.
|
*/

$kernel = $app->make(Illuminate\Contracts\Http\Kernel::class);

$response = $kernel->handle(
    $request = Illuminate\Http\Request::capture()
);

$response->send();

$kernel->terminate($request, $response);
Member Avatar for diafol

You.ve included your password! Change it

Member Avatar for diafol

Sounds like you.re attempting to connect to a remote db from localhost but it won.t let you. You may have to whitelist your local ip address to allow the connection.

DB_HOST=soulfy.com DB_DATABASE=wwwsoulf_revsoul DB_USERNAME=wwwsoulf_revsoul DB_PASSWORD=****

Now, I am having trouble importing my online database offline.

I already change the php.ini

php.ini

upload_max_filesize = 10M
post_max_size = 10M

No data was received to import. Either no file name was submitted, or the file size exceeded the maximum size permitted by your PHP configuration.

The sql file is only 2.6 MB (To import in my xampp)

How to handle this problem?

Member Avatar for diafol

Create a dump of your DB and export to .sql file. Download using FTP client like Filezilla. Open your MySQL GUI like phpMyAdmin or whatever else you use and import the file. Not sure what this is about with php.ini. That's for uploading files from somewhere on your local system to your local website system.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.