i want to upload a web site the shared server.
structure
public_html
Yii(folder)
index.php (inside root folder)
I'm just getting this message "Server ERROR".please can someone tell me where is the problem or what should i change in my code to make it work.here is my index code:
<?php
// yii directory paths<br/>
$yii=dirname(__FILE__).'/yii/yii.php';
$config=dirname(__FILE__).'/protected/config/main.php';
// remove the following lines when in production mode<br/>
defined('YII_DEBUG') or define('YII_DEBUG',true);
// specify how many levels of call stack should be shown in each log message<br/>
defined('YII_TRACE_LEVEL') or define('YII_TRACE_LEVEL',3);
require_once($yii);
Yii::createWebApplication($config)->run();
?>
If you could install a welcome yii application successfully then it is the problem of the index.php file in your app itself. One easy method is to copy the index.php file generated by your demo app and copy paste it in your original app. Make sure to keep the app in the same place where you kept your demo app.
Also, make sure that your vendor directories are there if you have used composer as well. Then check if the permissions are given correctly to the folders. Specifically the runtime and the assets folder. If in doubt you can simply chmod 777 on them.
If it is still giving error then there must be a problem with something you are using within your app which is probably missing something.
P.s please do express the error message properly so that we can get a better idea of the problem that you are facing.
Related
I zipped all my files before uploading it to elastic beanstalk. However I'm getting an error message:
Not Found
The requested URL /was not found on this server.
I did some research and came across the following post:
https://forums.aws.amazon.com/thread.jspa?threadID=127927
"The '403 Forbidden' error was because of the file structure of the zip folder. In order to upload properly please highlight/select all the contents "inside" the folder then you can compress/zip the contents and not the folder itself. That is, you cannot have a nested folder inside the zip."
I have done as told, except that I have selected the files AND 2 folders which contain some files. This may be causing the issue(?)
What should I do?
As you have mentioned that you are facing “The requested URL /was not found on this server”, you need to ensure the following:
1: Make sure your application has the file that .htaccess is
redirecting to your welcome page. 2: You need to set the public
folder as the root folder. For this, go to the Elastic Beanstalk
Console and Click on “Configurations”, then modify Software . Update
the “Document root” to the folder that contains your site's
default page. For example /public if the welcome page is in a folder
named public.
I wrote a joomla 3.x simple web site on my local machine and it worked fine. I deployed this to 1&1.com and the front end works fine but the control panel throws an error each time I try to log in saying "0: cannot write to log".
I have tried relative and absolute paths to the log folder in the $log_path parameter of the configuration.php and changed the permissions to the folder and files to all sorts of combinations and still I get the same error? I have created a new log folder and pointed the to that and still no joy?
has anyone come across this error using 1&1.com? I see some suggestions that 1&1.com are really bad with joomla support and I may be best trying another host? I am in 30 day money back guarantee so that is going to be my next move.
Cheers
Alex
First check this link https://joomla.stackexchange.com/questions/4673/error-0-cannot-open-file-for-writing-log-while-updating and if everything is fine and still this doesnt help then proceed to next step
Step:1 get the base path by writing this code to a file and uploading it through ftp
<?php
$basepath = getcwd();
echo "Your base Path is: ";
echo $basepath;
?>
When you run that file suppose it is named base.php then go to http://yoursite.com/base.php and get your base path.
Step:2 Create a new log and tmp folder
Now as You have got the base path, create a folder in your main joomla installation and name it newlog with permission 755.
Step:3 Change path in GLobal Configuration
In your global configuration give the base path appending the new folder path. Suppose you get basepath as /var/www/joomla then uou give the log path as
/var/www/joomla/newlog
I imagine you might have asked 1&1 already, it may be something they know very well.
Anyway make sure you have the correct configuration paths (absolute!) in the configuration.php and that the folder and its files are writable by the user who runs the website instance.
Also clear /cache and /administrator/cache for good measure, as they may have cached some non-authenticated results.
I tried to reorganise my facebook application files into better folders and now when I try to load my application on facebook it throws the following error:
Warning: require_once(../scripts/mysql_connect.php) [function.require-once]: failed to open stream: No such file or directory in C:\xampp\htdocs\<root folder>\Model\Database.php on line 3
Fatal error: require_once() [function.require]: Failed opening required '../scripts/mysql_connect.php' (include_path='.;C:\xampp\php\PEAR') in C:\xampp\htdocs\<root folder>\Model\Database.php on line 3
The second error is a result of the failure of the first one I think. The weird thing is that my program works perfectly fine when I'm accessing through the localhost url in the browser but when I run it through facebook it throws this error.
In my root folder I have a "Model" folder where the Database.php file is kept and a "scripts" folder where the mysql_connect.php file is kept. I have tried clearing my cache on the browser and using private browsing but it is still throwing this error.
Does anyone know what could be wrong?
EDIT: Sorry this does not seem to be working in localhost either now! One thing I think is weird is that it says "failed to open stream : NO SUCH FILE OR DIRECTORY IN" and then lists the database.php path. Why is it looking in there?
I use the line require_once('../scripts/mysql_connect.php'); at the top of my Database.php file to include it.
It seems that on the server there is a different working directory. Something like the following owuld be a quick fix
dirname(__FILE__) . '/../scripts/mysql_connect.php'
Ok I've fixed this, but I'm still unsure why it was a problem. In my root folder I have two folders: scripts, and Model. I have a database.php file in my Model folder which has the following line of code in:
require_once('../scripts/mysql_connect.php');
For some reason this did not work, but by replacing the line with:
require_once('/scripts/mysql_connect.php');
This started working again! Just thought I would post the solution. Does anyone know why the other way failed? I thought the ".." just makes it go up one level in the folder hierarchy i.e. to the root folder in this case, and then follow the path which would have taken it to the file...
EDIT: This appears to only have solved it for localhost and not through Facebook...
Do you have permission to edit your php.ini file? One solution would be to find the line with the include path (you'll notice it has C:\xampp\php\PEAR in there already). Include the full path to the "scripts" folder you're referencing, then you can change the php code to read:
require_once('mysql_connect.php');
PHP will be able to find this file since it's in the include path. Just make sure that if you start adding several include paths that you shouldn't have a file named mysql_connect.php in two or more of the different include paths because you'll most likely get errors. Hope this helps. It definitely makes for some cleaner code.
I'm writing a plugin for my editor to support the Yii framework.
To make this plugin work I need to find out 2 paths from index.php: the
framework and configuration paths.
The usual index.php (which is the entry point for Yii) looks like this:
<?php
// change the following paths if necessary
$yii=dirname(__FILE__).'/../../../../../usr/share/php-libs/framework/yii.php';
$config=dirname(__FILE__).'/protected/config/main.php';
// remove the following lines when in production mode
defined('YII_DEBUG') or define('YII_DEBUG',true);
// specify how many levels of call stack should be shown in each log message
defined('YII_TRACE_LEVEL') or define('YII_TRACE_LEVEL',3);
require_once($yii);
Yii::createWebApplication($config)->run();
Basically I need to get list of required files and arguments for Yii::createWebApplication().
But the code here can be anything. Literally anything. So is it possible to run this file somehow up to Yii::createWebApplication() so I could find out where the application directory is and where the framework is?
You can use Yii::app()->basePath to get the root path of the application, and Yii::app()->baseUrl to get the relative URL for the application.
The Yii framework must to be in root htdocs of the Apache.
I have found a little script which looks interesting, you can download the svn from google code at
http://code.google.com/p/streetwire/source/browse/
I am trying to set it up on my xampp localhost install, and there is little documentation, here are the first two lines of the config
// Paths
define('VHOST_DIR', '/data/vhost');
define('ROOT_DIR', VHOST_DIR . '/www.streetwire.org');
I have tried the following settings but it doesnt seem to work
// Paths
define('VHOST_DIR', 'C:/xampp/htdocs');
define('ROOT_DIR', VHOST_DIR . '/streetwirescript');
For anyone who has looked at the script, im not sure where to go for the 'start' page of the script either!!
Any thoughts on what should go into Vhost_dir?
Searching through the trunk (http://www.google.com/codesearch?q=root_dir+package%3Ahttp%3A%2F%2Fstreetwire.googlecode.com&origq=vhost_dir&btnG=Search+Trunk), VHOST_DIR is only used to define ROOT_DIR. It looks like all that matters is that ROOT_DIR points to the folder that the script is located in.
It's also possible that the script doesn't run on Windows.
It looks like you need to set /docs as the document root for this to work. E.g. index.php I assume you've seen INSTALL too.
Do you have error reporting on and set to maximum? There's a devsite constant in config that I assume gives error information too. What errors are you getting?