![]() |
PHP coding error on site
I receive the following error at my current website:
Code:
Warning: require_once(/home/vaporman/public_html/../medical/framework/yii.php) [function.require-once]: failed to open stream: No such file or directory in /home/vaporman/public_html/index.php on line 12 |
Code:
Warning: require_once(/home/vaporman/public_html/../medical/framework/yii.php) [function.require-once]: failed to open stream: No such file or directory in /home/vaporman/public_html/index.php on line 12 |
Quote:
|
So delete the ../ bit then.
|
I fixed that issue. Now a new error:
Code:
Parse error: syntax error, unexpected T_STRING, expecting ')' in /home/vaporman/public_html/protected/config/main.php on line 58 |
The line in RED is line 58. ???
Code:
), |
Thats not the complete line. It's part of a function call spread over multiple lines (hence the , characters).
What you need to do is use a program like notepad++ which has line numbering built in and will show you the REAL line 58. What you have shown me is something you THINK is line 58 but it actually isn't because it's been wrapped over multiple lines. Look at this for an example of how multiple lines do NOT increment the line number - in otherwords if it's wrapped, it shouldn't (unless you pressed return) have its own line number (look at lines 6 and 16): http://i50.tinypic.com/fp03ev.jpg But just in case, try deleting the , at the end of this: 'charset' => 'utf8', Otherwise you're going to need to post the entire script or at least a large amount more of it. |
I see. Would editpad lite work? I'll give it a go.
|
Hmmm. Is there some type of view or format that Notepad++ should be set to, because simply opening the file in Notepad++ still shows that as line 58, with no jumps in line number because of "wrapping".
|
Here is the script:
<?php // uncomment the following to define a path alias // Yii::setPathOfAlias('local','path/to/local-folder'); // This is the main Web application configuration. Any writable // CWebApplication properties can be configured here. return array( 'basePath'=>dirname(__FILE__).DIRECTORY_SEPARATOR.'..', 'name'=>'Retro-Daze', 'defaultController' => 'site', // preloading 'log' component 'preload'=>array('log'), // autoloading model and component classes 'import'=>array( 'application.models.*', 'application.components.*', ), 'modules'=>array( // uncomment the following to enable the Gii tool 'gii'=>array( 'class'=>'system.gii.GiiModule', 'password'=>'ashu', // If removed, Gii defaults to localhost only. Edit carefully to taste. 'ipFilters'=>array('127.0.0.1','::1'), ), ), // application components 'components'=>array( 'user'=>array( // enable cookie-based authentication 'allowAutoLogin'=>true, ), // uncomment the following to enable URLs in path-format 'urlManager'=>array( 'urlFormat'=>'path', 'showScriptName' => false, 'rules'=>array( '<controller:\w+>/<id:\d+>'=>'<controller>/view', '<controller:\w+>/<action:\w+>/<id:\d+>'=>'<controller>/<action>', '<controller:\w+>/<action:\w+>'=>'<controller>/<action>', ), ), 'db'=>array( 'connectionString' => 'sqlite:'.dirname(__FILE__).'/../data/testdrive.db', ), // uncomment the following to use a MySQL database 'db'=>array( 'connectionString' => 'mysql:host=localhost;dbname=*************', 'emulatePrepare' => true, 'username' => '**********', 'password' => '*********, 'charset' => 'utf8', ), 'errorHandler'=>array( // use 'site/error' action to display errors 'errorAction'=>'site/error', ), 'log'=>array( 'class'=>'CLogRouter', 'routes'=>array( array( 'class'=>'CFileLogRoute', 'levels'=>'error, warning', ), // uncomment the following to show log messages on web pages /* array( 'class'=>'CWebLogRoute', ), */ ), ), ), // application-level parameters that can be accessed // using Yii::app()->params['paramName'] 'params'=>array( // this is used in contact page 'adminEmail'=>'ashutosh2801@gmail.com', ), ); |
[php][/php] tags would have been nice. I've replied for you enough times for you to see it in my signature :rolleyes:
Where did you get this code? It's awfully formatted and frankly I found it hard to match up any ( and ) symbols. This line (actually 58): 'password' => '*********, Has a missing ' at the end of the * characters and again on line 145. On line 88 you have this: ); <?php You're reopening PHP when the code is already in PHP. That will cause more problems. Who wrote this? I don't like it. |
Sorry for that. I'm a bit of a novice. The code was written by a developer I hired from Freelancer.com. They had high marks, but that doesn't always mean something.
PHP Code:
|
IF you re-read my last post, you'll see that I've posted my comments on 3 faults I found for you to fix.
As for the developer.. :rolleyes: |
Thank for that Tango. With your help I was able to get the site running. Though, I am finding some bugs. Here is one error I encountered and it's respective code:
Code:
Fatal error: Call to undefined method stdClass::update() in /home/vaporman/public_html/protected/controllers/SiteController.php on line 1231PHP Code:
This error occurs when a user is logged in to my site and views a forum thread, then clicks the "RetroDaze" logo to return to the home page. The site is located here: www.retro-daze.com |
I don't do object oriented programming (which is what your code is relating to) so can't comment on it really I'm afraid.
Have you tried asking the original coder to fix this? It is their responsibility really - if they can't write working code then they need to fix it for you. Others here may be able to help you but it may be a bit long winded. |
| All times are GMT +1. The time now is 03:36 PM. |
Powered by vBulletin®
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.