When I uploaded my Laravel 4 application on a live web server I get the following error when going to the base URL:
Warning: require(/home/pvanmoll/domains/iheal.be/public_html/../laravel/bootstrap/autoload.php) [function.require]: failed to open stream: No such file or directory in /home/pvanmoll/domains/iheal.be/public_html/index.php on line 21
Fatal error: require() [function.require]: Failed opening required '/home/pvanmoll/domains/iheal.be/public_html/../laravel/bootstrap/autoload.php' (include_path='.:/usr/local/lib/php') in /home/pvanmoll/domains/iheal.be/public_html/index.php on line 21
I have put my laravel-files in a separate folder next to public_html. In public html I put the content of laravel's public folder.
This is my data structure:
laravel
/app
/bootstrap
/vendor
...
public_html
/css
/js
index.php
...
In index.php I specified following lines:
require __DIR__.'/../laravel/bootstrap/autoload.php';
$app = require_once __DIR__.'/../laravel/bootstrap/start.php';
and in laravel/bootstrap/paths.php:
'public' => __DIR__.'/../../public_html',
On localhost everything runs fine, but when I upload it to my live web server, it won't work. I've been searching for days now and nothing can help me. Weird thing is that the two dots for going down a folder, won't work as they are just appended to my url instead of going down a folder.
Maybe it's because my web server is running on Php 5.3.27?
You need at least PHP >= 5.3.7 with L4. And why don't you change the web root on the server instead? Is it shared hosting?
You could also put all laravel install inside public_html, update bootstrap/path.php and index.php and redirect to laravel public with a htaccess. But this is definitely not recommended !
Related
I have a custom PHP file that needs placing in a the cpanel/root folder. Any root folder, be it newly created or /usr/local/cpanel/scripts/.
This is the error I got, when I placed it in one of my accounts:
PHP Warning: opendir(/var/named/): failed to open dir: No such file or directory in /home/****/public_html/cpanel-slave-zones-add.php on line 46
This the response I got from the script developers:
The "ZONES_DIR" is pre-defined in the PHP file as "/var/named/". However, since you are received such error, we recommend you to place the script into the root directory ("/").
Do you know where should I put this script, so it can function properly? Do you know, ways to go about?
I am struggling trying to figure out why my require path link is not working.
My folder setup is the following:
Main domain on server test.example.com.
public_html -> test.example.com -> PHPMailer -> PHPMailerAutoload.php
Since the main domain is test.example.com, I am putting test.example.com in the path url. I have to do this for any link on the site (it was a setup mistake, but I haven't changed it yet).
The way I am trying to access this folder is below:
require 'test.example.com/test.example.com/PHPMailer-master/PHPMailerAutoload.php';
I get the following errors:
Warning: require(test.example.com/PHPMailer-master/PHPMailerAutoload.php): failed to open stream: No such file or directory in /home/example/public_html/test.example.com/php/newsletterSend.php on line 4
Warning: require(test.example.com/test.example.com/PHPMailer-master/PHPMailerAutoload.php): failed to open stream: No such file or directory in /home/example/public_html/test.example.com/php/newsletterSend.php on line 4
Fatal error: require(): Failed opening required 'test.example.com/test.example.com/PHPMailer-master/PHPMailerAutoload.php' (include_path='.:/opt/cpanel/ea-php71/root/usr/share/pear') in /home/example/public_html/test.example.com/php/newsletterSend.php on line 4
I need the link to be an absolute path because the file will be used in different folders.
Does anyone see what I am doing wrong?
it looks like your php is in a directory above the phpMailer folder.. so i think the path would be "../PHPMailer/PHPMailerAutoload.php"
you can use absolute paths if its simpler:
/home/foo/public_html/test.example.com/PHPMailer/PHPMailerAutoload.php
or relative paths if you know where you're starting!
../PHPMailer/PHPMailerAutoload.php
I have read lots of tutorial on hosting laravel 4 based app on shared hosting .But I am not able to deploy it successfully . I am getting following error
Warning: require(__DIR__/../bootstrap/autoload.php) [function.require]: failed to open stream: No such file or directory in D:\Hosting\10588605\html\healthscape\ideconnect\public\index.php on line 41
Fatal error: require() [function.require]: Failed opening required '__DIR__/../bootstrap/autoload.php' (include_path='.;C:\php5\pear') in D:\Hosting\10588605\html\healthscape\ideconnect\public\index.php on line 41
I have website in which I want to deploy my app . For example I have this website .
http://healthscapeseries.com
I want to add my laravel app to this like
http://healthscapeseries.com/myappname/public/
it should point to my app. Can any one help me out with this .
Thanks in advance
It will be better if you point to your app like
http://healthscapeseries.com/myappname
For attaining this do following steps
Create a folder myappnamebase in your document folder
Put all your contents of the application except the public folder content to myappnamebase folder
Create new folder in public_html named myappname
Put all your public folder content in myappname folder
Then bring the following changes:
Inside public_html->myappname->index.php
instead of
require __DIR__.'/../bootstrap/autoload.php';
add
require __DIR__.'/../../myappnamebase/bootstrap/autoload.php';
instead of
$app = require_once __DIR__.'/../bootstrap/start.php';
add
$app = require_once __DIR__.'/../../myappnamebase/bootstrap/start.php';
Inside myappnamebase->bootstrap->paths.php do editting so that it looks like following
'app' => __DIR__.'/../../myappnamebase/app',
'public' => __DIR__.'/../../public_html/myappname',
'base' => __DIR__.'/../../myappnamebase',
'storage' => __DIR__.'/../../myappnamebase/app/storage',
I have a project, build in Yii Framework , in my machine 1.
Now I moved my whole project to new laptop.
But it's not running and displaying some error:
Warning: require_once(D:\xampp\htdocs\rpadmin/../framework/yii.php): failed to open stream: No such file or directory in D:\xampp\htdocs\rpadmin\index.php on line 11
Fatal error: require_once(): Failed opening required 'D:\xampp\htdocs\rpadmin/../framework/yii.php' (include_path='.;D:\xampp\php\PEAR') in D:\xampp\htdocs\rpadmin\index.php on line 11
Does anyone know what is happening?
You need to edit in your project the file index.php and change the line:
// change the following paths if necessary
$yii=dirname(__FILE__).'/../framework/yii.php';
$config=dirname(__FILE__).'/protected/config/main.php';
with your Yii Framework path location.
If you have framework folder in the same location with the project, you need to change like this:
$yii=dirname(__FILE__).'/framework/yii.php';
actually u have folder of yii(framework named folder) framework outside the rpadmin folder now u have to upload it from your local machine to the server and put it outside the rpadmin from... the error message ...
Warning: require_once(D:\xampp\htdocs\rpadmin/../framework/yii.php):
so there will be a framework named folder....
after that make some changes
Give rpadmin/protected/runtime permission 777
If its ISS the you have to give rpadmin/assets folder permission 777
change the required settings in rpadmin/protected/config/main.php if theres only like db connection
I store my WordPress theme in my Dropbox to use it easily on many machines. Unfortunately require_once()/include_once() doesn't seem to work for me.
Is store original theme at G:\Dropbox\Dropbox\Wordpress\Themes\Blabla\
The symlink is placed at C:\xampp\htdocs\blabla\wp-content\themes\Blabla
When I wanted to require/include any file, eg. C:\xampp\htdocs\blabla\wp-load.php I used to do require_once('../../wp-load.php');
But with symlink all I got is:
Warning: require_once(../../../wp-load.php): failed to
open stream: No such file or directory in
G:\Dropbox\Dropbox\Wordpress\Themes\Blabla\foo\bar.php on line
2 Fatal error: require_once(): Failed
opening required '../../../wp-load.php'
(include_path='.;C:\xampp\php\PEAR') in
G:\Dropbox\Dropbox\Wordpress\Themes\Blabla\foo\bar.php on line
2
Looks like require_once looks for the file within the Dropbox, not symlink context? Is it possible to fix it somehow? I can't use absolute path as I develop on different machines / different OSes and those vary... Any ideas? How does require_once work when it's symlinked? Does it look for required file in both places (original-context & symlink-context)?
How about putting the original file into you Wordpress folder and symlinking to dropbox?
While installing this, you should turn off dropbox on all machines where you did not move the folder yet.