I believe it is much the same as a Laravel 4 upload.
I have my setup as follows, is this correct?
Is the only file I need to amend the index.php file which in my case is in the techjobs folder? I have amended this file to suit the directory structure. Are there any other files that need to change?
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__.'/../../techjobs-laravel-base/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__.'/../../techjobs-laravel-base/bootstrap/app.php';
/*
|--------------------------------------------------------------------------
| Run The Application
|--------------------------------------------------------------------------
|
| Once we have the application, we can simply call the run method,
| which will execute the request and send the 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');
$response = $kernel->handle(
$request = Illuminate\Http\Request::capture()
);
$response->send();
$kernel->terminate($request, $response);
Right now you have too many steps back in your folders with ../ . Please try using below instead
require __DIR__.'/../techjobs-laravel-base/bootstrap/autoload.php';
and
$app = require_once __DIR__.'/../techjobs-laravel-base/bootstrap/app.php';
Related
i want to create download excel function using laravel-excel.maatwebsitelibrary. my code like below :
return Excel::download(new PembukuanExport, 'pembukuan.xlsx');
but when i ran it, it gave me error like this
Could not open /var/folders/n_/xh_10hm50dvbwg23cfq_kw3h0000gn/T/laravel-excel-DMBN3reNUrSiamYT for writing.
my laptop is macbook, been googling but cant find the right answer
It might be too late to answer this, but I guess you need to configure your excel.php config files.
Publish excel config files:
php artisan vendor:publish --provider="Maatwebsite\Excel\ExcelServiceProvider"
Now in config/excel.php files you need to do configuration:
'temporary_files' => [
/*
|--------------------------------------------------------------------------
| Local Temporary Path
|--------------------------------------------------------------------------
|
| When exporting and importing files, we use a temporary file, before
| storing reading or downloading. Here you can customize that path.
|
*/
'local_path' => storage_path(),
/*
|--------------------------------------------------------------------------
| Remote Temporary Disk
|--------------------------------------------------------------------------
|
| When dealing with a multi server setup with queues in which you
| cannot rely on having a shared local temporary path, you might
| want to store the temporary file on a shared disk. During the
| queue executing, we'll retrieve the temporary file from that
| location instead. When left to null, it will always use
| the local path. This setting only has effect when using
| in conjunction with queued imports and exports.
|
*/
'remote_disk' => null,
],
This will set the temporary folder to your storage path which has permission to execute things. Hope this find helpful to others.
i solved this by changing User & Group in `httpd.conf.
Open httpd.config.
Search keyword "User or Group" and change it.
User your_mac_user and fill in Group staff
Due to a client issue i have to put a laravel 4 application on shared hosting service.But i followed this process at [laravelio]which includes.
Place the files of the laravel public folder i.e. css, img, js etc; into public_html folder (don't dump public folder instead dump the files and folders in it).
Put all the remaining folders & files into another folder, say 'laravelcore' and place the laravelcore folder in the root (/home5/username/)
Open index.php in the public_html folder and replace the following lines as mentioned
require DIR.'/../bootstrap/autoload.php';
require __DIR__.'/../laravelcore/bootstrap/autoload.php';
$app = require_once DIR.'/../bootstrap/start.php';
$app = require_once __DIR__.'/../laravelcore/bootstrap/start.php';
Open paths.php file in laravelcore/bootstrap and replace the following line
'public' => DIR.'/../public',
'public' => __DIR__.'/../../public_html',
which is suppose to work but when i visit the url i get this : The requested URL /login was not found on this server.please what may be the problem as i dont get it.may be its about configuring the .htacces file.
Any help would be appriciated.Thanks
website is at :benin1897.com
i just discovered that there is no .htaccess file in th public_html folder.could that be the problem...
here is my file tree
(/home/benincom)
etc
logs
mail
oysg
app
bootstrap
vendor
publicftp
public_html
css
js
error_log
readme
pakage.json
robots.txt
tmp
NOW AM LOGGED ON BUT LARAVEL THROWS ME ERROR
/ / |-------------------------------------------------------------------------- | Register The Auto Loader |-------------------------------------------------------------------------- | | Composer provides a convenient, automatically generated class loader | for our application. We just need to utilize it! We'll require it | into the script here so that we do not have to worry about the | loading of any our classes "manually". Feels great to relax. | / require DIR.'/../oysg/bootstrap/autoload.php'; / |-------------------------------------------------------------------------- | Turn On The Lights |-------------------------------------------------------------------------- | | We need to illuminate PHP development, so let's 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 these users. | / $app = require_once DIR.'/../oysg/bootstrap/start.php'; / |-------------------------------------------------------------------------- | Run The Application |-------------------------------------------------------------------------- | | Once we have the application, we can simply call the run method, | which will execute the request and send the response back to | the client's browser allowing them to enjoy the creative | and wonderful application we have whipped up for them. | */ $app->run();
Do you've got the route for login handeld in your /app/routes.php like this?
Route::get('/login', 'LoginController#login');
Or if you don't use Controllers ( Which isn't an good idea, but for quick / dirty testing... )
Route::get('/login', function(){
echo "Now we're going to login on this awesome website!!!";
});
More about the Laravel Routes
Edit 1
The Controller file ( /app/controllers/LoginController.php ):
<?php
class LoginController extends BaseController {
public function login() {
echo "Now we are going to login in this awesome website!!!";
// return View::make('pages/overig/login');
}
}
You stated that there isn't an .htaccess file in you public folder. There should be one.
Create the file and insert this content and try it again:
<IfModule mod_rewrite.c>
<IfModule mod_negotiation.c>
Options -MultiViews
</IfModule>
RewriteEngine On
# Redirect Trailing Slashes...
RewriteRule ^(.*)/$ /$1 [L,R=301]
# Handle Front Controller...
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^ index.php [L]
</IfModule>
It sounds like the .htaccess file is not configured properly so you are not getting the 'pretty URLs'. Try copying the example file from here to your .htaccess http://laravel.com/docs/4.2/installation#pretty-urls.
In the meantime you should be able to access your application by prepending index.php. For instance /login wasn't working for you, but if you try /index.php/login it will work
I'm a trying to install Laravel
My problem is:
/localhost/laravel displays its content like the folders under it.
but I am expecting something like the logo of laravel and the text "You have arrived."
I believe that the error is something in my paths.php:
return array(
/*
|--------------------------------------------------------------------------
| Application Path
|--------------------------------------------------------------------------
|
| Here we just defined the path to the application directory. Most likely
| you will never need to change this value as the default setup should
| work perfectly fine for the vast majority of all our applications.
|
*/
'app' => __DIR__.'/../app',
/*
|--------------------------------------------------------------------------
| Public Path
|--------------------------------------------------------------------------
|
| The public path contains the assets for your web application, such as
| your JavaScript and CSS files, and also contains the primary entry
| point for web requests into these applications from the outside.
|
*/
'public' => __DIR__.'/../public',
/*
|--------------------------------------------------------------------------
| Base Path
|--------------------------------------------------------------------------
|
| The base path is the root of the Laravel installation. Most likely you
| will not need to change this value. But, if for some wild reason it
| is necessary you will do so here, just proceed with some caution.
|
*/
'base' => __DIR__.'/..',
/*
|--------------------------------------------------------------------------
| Storage Path
|--------------------------------------------------------------------------
|
| The storage path is used by Laravel to store cached Blade views, logs
| and other pieces of information. You may modify the path here when
| you want to change the location of this directory for your apps.
|
*/
'storage' => __DIR__.'/../app/storage',
);
and index.php
require __DIR__.'/../bootstrap/autoload.php';
$app = require_once __DIR__.'/../bootstrap/start.php';
$app->run();
It's not your path. You should create a virtual host and point the virtual host's root to laravel/public.
i have a magento site main domain.
i did the following steps :
1.Downloaded the full magento site from main domain(mydomain.com)
2.Created a sub domain as new.mydomain.com(in plesk)
3.Uploaded the full magento site in to sub domain.
4.Created new database and imported the database.
5.Changed the secure url and unsecure url as 'http://www.new.mydomain.com/' in core_config_table.
6.Changed the local.xml file with new database details.
The above steps i did.
Then i take the sub domain as new.mydomain.com in browser, but it goes to main domain(mydomain.com).
What is the reason for that?
I contacted the client, the client give me the information that, there is no server problem. It is in your code.
So what is the problem here?
Is there is any redirection to main domain from sub domain?
Or is there is any file taken from main domain instead of sub domain?
How can i solve this?
Are there any additional steps here i need to do?
I already checked the index.php page:
Here, i give an echo statement before Mage::run($mageRunCode, $mageRunType);
that is :
echo "test";
die();
Mage::run($mageRunCode, $mageRunType
Then the test will be displayed.
So when running mage it redirects to main domain.
fwiw: magento stores the "domain" information in at least two records in the core_config_data table:
mysql> select * from core_config_data where value like '%mydomain.com/';
+-----------+---------+----------+-----------------------+----------------------+
| config_id | scope | scope_id | path | value |
+-----------+---------+----------+-----------------------+----------------------+
| 4 | default | 0 | web/unsecure/base_url | http://mydomain.com/ |
| 5 | default | 0 | web/secure/base_url | http://mydomain.com/ |
| 1488 | stores | 2 | web/unsecure/base_url | http://mydomain.com/ |
| 1489 | stores | 2 | web/secure/base_url | http://mydomain.com/ |
+-----------+---------+----------+-----------------------+----------------------+
Before making the backup of the database, or even after backing it up, but before attempting to make the new site live, run an update statement:
update core_config_data set value = 'http://mynewdomain.com' where value = 'http://mydomain.com'
And then the site should come up fine.
Another method is to change the secure and the unsecure urls in the System->Configuration->web section and then saving the database.
SS
Have you clean cache ? ( removing /var/cache dir ) ?
You can try by phpmyadmin searching for mydomain.com in all the database and change it.
I have a strange problem:
I am using MAMP and Codeigniter and I see that view is not showing anything on the browser. Model works and the DB is wired up.
Here is the code that does not work on the local host:
$this->load->view('test/db_tester_view',$data);
Sadly there is no error messages!!? but here is the config:
$config['base_url'] = 'http://localhost:8888';
$config['index_page'] = '';
$config['uri_protocol'] = 'REQUEST_URI';
I spend 20 hours on this so your help is appreciated
Some tips:
Make sure error reporting is on, as usual (this should be in your bootstrap file, index.php):
error_reporting(E_ALL);
ini_set('display_errors', 1);
Make sure you did not disable these directives somewhere else in your script.
Windows and *NIX deal with uppercase/lowercase file names differently. Make sure your files are all normalized to lowercase to avoid problems with different operating systems.
The base url needs a trailing slash:
/*
|--------------------------------------------------------------------------
| Base Site URL
|--------------------------------------------------------------------------
|
| URL to your CodeIgniter root. Typically this will be your base URL,
| WITH a trailing slash:
|
| http://example.com/
|
| If this is not set then CodeIgniter will guess the protocol, domain and
| path to your installation.
|
*/
$config['base_url'] = 'http://localhost:8888/';
// OR...
$config['base_url'] = ''; // automagic
If you don't require the port to be set explicitly, you can remove it.