Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Page 1 of 2 12 LastLast
Results 1 to 15 of 18
  1. #1
    New to the CF scene
    Join Date
    Dec 2012
    Posts
    9
    Thanks
    5
    Thanked 0 Times in 0 Posts

    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
    
    Fatal error: require_once() [function.require]: Failed opening required '/home/vaporman/public_html/../medical/framework/yii.php' (include_path='.:/usr/lib/php:/usr/local/lib/php') in /home/vaporman/public_html/index.php on line 12
    What seems to be the issue?

  • #2
    Senior Coder
    Join Date
    Feb 2011
    Location
    Your Monitor
    Posts
    4,091
    Thanks
    51
    Thanked 506 Times in 493 Posts
    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
    The red bit is probably the error. You're trying to change up outside of public_html into another directory outside of it. I suspect medical is actually inside public_html not above it.
    My helpful sig is on vacation trying to loose some weight. It got a bit fat and caused a few problems but it will be back at some point!

  • Users who have thanked tangoforce for this post:

    vaporman87 (12-25-2012)

  • #3
    New to the CF scene
    Join Date
    Dec 2012
    Posts
    9
    Thanks
    5
    Thanked 0 Times in 0 Posts
    Quote Originally Posted by tangoforce View Post
    The red bit is probably the error. You're trying to change up outside of public_html into another directory outside of it. I suspect medical is actually inside public_html not above it.
    Yes. There is nothing outside of public_html related to the site.

  • #4
    Senior Coder
    Join Date
    Feb 2011
    Location
    Your Monitor
    Posts
    4,091
    Thanks
    51
    Thanked 506 Times in 493 Posts
    So delete the ../ bit then.
    My helpful sig is on vacation trying to loose some weight. It got a bit fat and caused a few problems but it will be back at some point!

  • Users who have thanked tangoforce for this post:

    vaporman87 (12-25-2012)

  • #5
    New to the CF scene
    Join Date
    Dec 2012
    Posts
    9
    Thanks
    5
    Thanked 0 Times in 0 Posts
    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

  • #6
    New to the CF scene
    Join Date
    Dec 2012
    Posts
    9
    Thanks
    5
    Thanked 0 Times in 0 Posts
    The line in RED is line 58. ???
    Code:
    ),
    		// 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',
            ),

  • #7
    Senior Coder
    Join Date
    Feb 2011
    Location
    Your Monitor
    Posts
    4,091
    Thanks
    51
    Thanked 506 Times in 493 Posts
    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):


    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.
    Last edited by tangoforce; 12-24-2012 at 07:39 PM.
    My helpful sig is on vacation trying to loose some weight. It got a bit fat and caused a few problems but it will be back at some point!

  • Users who have thanked tangoforce for this post:

    vaporman87 (12-25-2012)

  • #8
    New to the CF scene
    Join Date
    Dec 2012
    Posts
    9
    Thanks
    5
    Thanked 0 Times in 0 Posts
    I see. Would editpad lite work? I'll give it a go.

  • #9
    New to the CF scene
    Join Date
    Dec 2012
    Posts
    9
    Thanks
    5
    Thanked 0 Times in 0 Posts
    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".

  • #10
    New to the CF scene
    Join Date
    Dec 2012
    Posts
    9
    Thanks
    5
    Thanked 0 Times in 0 Posts
    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',
    ),
    );
    Last edited by vaporman87; 12-24-2012 at 09:55 PM.

  • #11
    Senior Coder
    Join Date
    Feb 2011
    Location
    Your Monitor
    Posts
    4,091
    Thanks
    51
    Thanked 506 Times in 493 Posts
    [php][/php] tags would have been nice. I've replied for you enough times for you to see it in my signature

    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.
    Last edited by tangoforce; 12-24-2012 at 10:18 PM.
    My helpful sig is on vacation trying to loose some weight. It got a bit fat and caused a few problems but it will be back at some point!

  • Users who have thanked tangoforce for this post:

    vaporman87 (12-25-2012)

  • #12
    New to the CF scene
    Join Date
    Dec 2012
    Posts
    9
    Thanks
    5
    Thanked 0 Times in 0 Posts
    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:
    <?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'=>'errorwarning',
                    ),
                    // 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,
        ),
    );
    Last edited by vaporman87; 12-25-2012 at 06:00 AM.

  • #13
    Senior Coder
    Join Date
    Feb 2011
    Location
    Your Monitor
    Posts
    4,091
    Thanks
    51
    Thanked 506 Times in 493 Posts
    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..
    My helpful sig is on vacation trying to loose some weight. It got a bit fat and caused a few problems but it will be back at some point!

  • Users who have thanked tangoforce for this post:

    vaporman87 (12-25-2012)

  • #14
    New to the CF scene
    Join Date
    Dec 2012
    Posts
    9
    Thanks
    5
    Thanked 0 Times in 0 Posts
    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 1231
    PHP Code:
            Yii::app()->user->setFlash('msgError','Sorry, your reply could not be posted. Please try again.');
                }
                
            }
            else
            {
                
    $forum->views+=1;
                
    $forum->update();
            }
            
            
    $cat ForumCategory::model()->findByPk($forum['category_id']); 
    $forum->update(); is line 1231. Any thoughts, or need more info?

    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
    Last edited by vaporman87; 12-25-2012 at 07:35 PM.

  • #15
    Senior Coder
    Join Date
    Feb 2011
    Location
    Your Monitor
    Posts
    4,091
    Thanks
    51
    Thanked 506 Times in 493 Posts
    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.
    My helpful sig is on vacation trying to loose some weight. It got a bit fat and caused a few problems but it will be back at some point!


  •  
    Page 1 of 2 12 LastLast

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •