'class_initializer.php' issues!

Forum
Last Post
Threads / Messages

zoe

the power of love
Member
Joined
Feb 2, 2015
Messages
25
Points
0
Age
24
Location
hell
Mysidian Dollar
2,554
Hello everyone!!
I've installed MAMP and set up the latest Mysidia script. When I launch localhost though I get this error:

PHP:
Warning: require(inc/config.php): failed to open stream: No such file or directory in /Applications/MAMP/htdocs/classes/class_initializer.php on line 97

Fatal error: require(): Failed opening required 'inc/config.php' (include_path='.:/Applications/MAMP/bin/php/php5.6.2/lib/php') in /Applications/MAMP/htdocs/classes/class_initializer.php on line 97

These are lines 95 through 97 of my class_initializer.php file:

PHP:
  private function initialize(){
        $config = "{$this->dir}inc/config.php";
        require $config;

I think it has to do with the MAMP setup, since ive heard its a lot like WAMP and when you install WAMP you have to mess around with your config.php file a bit. I haven't found any helpful MAMP tutorials though, so I can't be sure.
 
Confirm you've renamed the config file in the inc folder during installation. It's not named config, you have to rename inc/config_adopts.php to inc/config.php - no matter whether you're installing locally or on a hosted server.

step9_by_kyttias-d8fpept.gif


If you get more errors after this step, let me know. Keep referring to my WAMP tutorial, even though you're using MAMP! You may run across a lot of the same errors that need to be fixed in all the same ways - but navigating to where the files you need to edit in MAMP may be different. That's all! ^^;
 
Last edited:
I've installed MAMP just like your tutorial, but Im still getting a load of notices and a fatal error when i enter 127.0.0.1.

PHP:
Notice: Undefined variable: controller in /Applications/MAMP/htdocs/classes/class_language.php on line 111
Notice: Undefined property: FormRenderer::$thematicBreak in /Applications/MAMP/htdocs/classes/class_guirenderer.php on line 184
Notice: Undefined property: DocumentRenderer::$thematicBreak in /Applications/MAMP/htdocs/classes/class_guirenderer.php on line 184
Notice: Undefined property: ListRenderer::$thematicBreak in /Applications/MAMP/htdocs/classes/class_guirenderer.php on line 184
Fatal error: Uncaught exception 'SmartyException' with message 'Unable to load template file 'template.tpl'' in /Applications/MAMP/htdocs/inc/smarty/sysplugins/smarty_internal_templatebase.php:127 Stack trace: #0 /Applications/MAMP/htdocs/inc/smarty/sysplugins/smarty_internal_templatebase.php(374): Smarty_Internal_TemplateBase->fetch('template.tpl', NULL, NULL, NULL, true) #1 /Applications/MAMP/htdocs/classes/class_template.php(135): Smarty_Internal_TemplateBase->display('template.tpl') #2 /Applications/MAMP/htdocs/classes/class_view.php(280): Template->output() #3 /Applications/MAMP/htdocs/classes/class_frontcontroller.php(102): View->render() #4 /Applications/MAMP/htdocs/index.php(74): FrontController->render() #5 /Applications/MAMP/htdocs/index.php(78): IndexController::main() #6 {main} thrown in /Applications/MAMP/htdocs/inc/smarty/sysplugins/smarty_internal_templatebase.php on line 127

Most of these notices were repeated a lot. Ive changed the php.ini file, by the way!
 
If error reporting has been turned off in php.ini, the "notices" should not be occurring. Temporarily shut off MAMP, or restart your computer if you don't know how, and turn it back on. Major changes won't go through until the server has been restarted.

As for that particular fatal error, I've only seen that happen when the default theme is changed incorrectly. Did you change the default theme name during installation?

Other people with this error: [ x ], [ x ], [ x ], [ x ]

There is also an off chance your config.php is not filled with the correct information, or that the correct information was not entered during installation.
 
Last edited:
I messed a bit the the php.ini file a bit more and managed to fix it, I think. Now when I enter 127.0.0.1 everything is blank, like in x10hosting.

I tried fixing the class_path.php file, by changing the "/home/yoursitename/public_html/" to "/Applications/MAMP/htdocs/" (where the Mysidia files are stored). Nothing happened.

As for the themes, I haven't even touched the templates folder...
 
Don't change the class_path.php file.

As for the themes, please show me what your default theme for the entire site is by looking in your database under 'adopts_settings', that is, if you didn't change the adopts_ prefix to something else. I'd like to rule this out as a possibility, in case you changed 'main' to something else during installation.

Also, please post your config.php file contents so I can check for errors in the script path (hint: it should be completely empty unless your site is inside a folder inside it's directory). It should look like this (aside from the entries with '------' as those should be filled with relevant data):

define('DBHOST', 'localhost'); //DB Hostname
define('DBUSER', '------'); //DB Username
define('DBPASS', '------'); //DB Password
define('DBNAME', '------'); //Your database name
define('DOMAIN', '127.0.0.1'); //Your domain name (No http, www or . )
define('SCRIPTPATH', ''); //The folder you installed this script in
define('PREFIX', 'adopts_');
 
Last edited:
Okay. I fixed the config.php file back to its original.

By adopts_settings I suppose you mean in the phpMyAdmin. The only line on that file is

PHP:
SELECT * FROM `adopts_settings`

Which is kinda weird since everyone else seems to have a lot of things in there... Sorry, I'm really new to this!!

This is my config.php file:


PHP:
define('DBHOST', 'localhost');             //DB Hostname
define('DBUSER', '--------------');             //DB Username
define('DBPASS', '--------------');             //DB Password
define('DBNAME', '--------------');             //Your database name
define('DOMAIN', '127.0.0.1');             //Your domain name (No http, www or . )
define('SCRIPTPATH', '');     //The folder you installed this script in
define('PREFIX', 'adopts_');
?>
 
Mine looks like this:

adopts_settings_by_kyttias-d8h2l4u.png

*my theme is Bootstrap, but by default it should be main

If this table in the database is really empty, then the site never even finished installing. Visit http://127.0.0.1/install again, even if you had before, and reinstall the entire thing. You might need to drop the database first, but likely not.
 
I've fixed it, thank you! I had 0 rows in my adopts_settings file. Now I have 21 rows.

But whenever I try to log in or click any link in the index page, I get another error. If I were to click on 'login', Ill get redirected to http://127.0.0.1/login, and Ill get a 404 Not Found error.

It reads: "The requested URL /login was not found on this server."
 
I can't find a <VirtualHost> in my httpd.conf file... There are many AllowOverride lines in my httpd.conf file, though. I tried changing
<Directory />
Options Indexes FollowSymLinks
AllowOverride None
</Directory>
to
<Directory />
Options Indexes FollowSymLinks
AllowOverride All
</Directory>
but when I restarted the servers, the files were still not found.
 
Last edited:
This:
Go to httpd.conf on /Applications/MAMP/conf/apache and see if the LoadModule rewrite_module modules/mod_rewrite.so line is un-commented (without the # at the beginning)

The rest is not relevant. Is the rewrite module on (is that line uncommented) or not?

Yes or no answer, please don't go gallivanting into making changes until I know the situation, else it becomes very difficult to help you. In my tutorial I explained that mod_rewrite needed to be enabled, I'm sorry the process has to be done manually with MAMP, apparently, but it's literally just uncommenting a single line.

I'm just trying to rule out whether mod_rewite is/was on or not or the cause of your problem at all. It does need to be on.
 
Last edited:
Turn error reporting back on in php.ini and let me know what it says. We fixed one error but seem to have a different one.

It still bothers me that you didn't have rows in your database that should have been there during the initial install. Maybe other things are also missing and the best thing to do would be to purge the database entirely (or just create one with a different name), delete all the Mysidia files, unzip the original file again and put in a new copy, and start with a fresh install.

This really does baffle me. =/
 
Ive re-installed the entire thing.

Here is the complete error log. Its really long so I put it under a spoiler.


  Spoiler: error log 
PHP:
Notice: Undefined variable: controller in /Applications/MAMP/htdocs/classes/class_language.php on line 111

Notice: Undefined property: FormRenderer::$thematicBreak in /Applications/MAMP/htdocs/classes/class_guirenderer.php on line 184

Notice: Undefined property: FormRenderer::$thematicBreak in /Applications/MAMP/htdocs/classes/class_guirenderer.php on line 184

Notice: Undefined property: FormRenderer::$thematicBreak in /Applications/MAMP/htdocs/classes/class_guirenderer.php on line 184

Notice: Undefined property: FormRenderer::$thematicBreak in /Applications/MAMP/htdocs/classes/class_guirenderer.php on line 184

Notice: Undefined property: FormRenderer::$thematicBreak in /Applications/MAMP/htdocs/classes/class_guirenderer.php on line 184

Notice: Undefined property: FormRenderer::$thematicBreak in /Applications/MAMP/htdocs/classes/class_guirenderer.php on line 184

Notice: Undefined property: FormRenderer::$thematicBreak in /Applications/MAMP/htdocs/classes/class_guirenderer.php on line 184

Notice: Undefined property: FormRenderer::$thematicBreak in /Applications/MAMP/htdocs/classes/class_guirenderer.php on line 184

Notice: Undefined property: FormRenderer::$thematicBreak in /Applications/MAMP/htdocs/classes/class_guirenderer.php on line 184

Notice: Undefined property: DocumentRenderer::$thematicBreak in /Applications/MAMP/htdocs/classes/class_guirenderer.php on line 184

Notice: Undefined property: DocumentRenderer::$thematicBreak in /Applications/MAMP/htdocs/classes/class_guirenderer.php on line 184

Notice: Undefined property: ListRenderer::$thematicBreak in /Applications/MAMP/htdocs/classes/class_guirenderer.php on line 184

Notice: Undefined property: ListRenderer::$thematicBreak in /Applications/MAMP/htdocs/classes/class_guirenderer.php on line 184

Notice: Undefined property: ListRenderer::$thematicBreak in /Applications/MAMP/htdocs/classes/class_guirenderer.php on line 184

Notice: Undefined property: ListRenderer::$thematicBreak in /Applications/MAMP/htdocs/classes/class_guirenderer.php on line 184

Notice: Undefined property: ListRenderer::$thematicBreak in /Applications/MAMP/htdocs/classes/class_guirenderer.php on line 184

Notice: Undefined property: ListRenderer::$thematicBreak in /Applications/MAMP/htdocs/classes/class_guirenderer.php on line 184

Notice: Undefined property: ListRenderer::$thematicBreak in /Applications/MAMP/htdocs/classes/class_guirenderer.php on line 184

Notice: Undefined property: ListRenderer::$thematicBreak in /Applications/MAMP/htdocs/classes/class_guirenderer.php on line 184

Notice: Undefined property: ListRenderer::$thematicBreak in /Applications/MAMP/htdocs/classes/class_guirenderer.php on line 184

Notice: Undefined property: ListRenderer::$thematicBreak in /Applications/MAMP/htdocs/classes/class_guirenderer.php on line 184

Notice: Undefined property: ListRenderer::$thematicBreak in /Applications/MAMP/htdocs/classes/class_guirenderer.php on line 184

Notice: Undefined property: ListRenderer::$thematicBreak in /Applications/MAMP/htdocs/classes/class_guirenderer.php on line 184

Notice: Undefined property: ListRenderer::$thematicBreak in /Applications/MAMP/htdocs/classes/class_guirenderer.php on line 184

Notice: Undefined property: ListRenderer::$thematicBreak in /Applications/MAMP/htdocs/classes/class_guirenderer.php on line 184

Notice: Undefined property: ListRenderer::$thematicBreak in /Applications/MAMP/htdocs/classes/class_guirenderer.php on line 184

Notice: Undefined property: ListRenderer::$thematicBreak in /Applications/MAMP/htdocs/classes/class_guirenderer.php on line 184

Notice: Undefined property: ListRenderer::$thematicBreak in /Applications/MAMP/htdocs/classes/class_guirenderer.php on line 184

Notice: Undefined property: ListRenderer::$thematicBreak in /Applications/MAMP/htdocs/classes/class_guirenderer.php on line 184

Notice: Undefined property: ListRenderer::$thematicBreak in /Applications/MAMP/htdocs/classes/class_guirenderer.php on line 184

Notice: Undefined property: ListRenderer::$thematicBreak in /Applications/MAMP/htdocs/classes/class_guirenderer.php on line 184

Notice: Undefined property: ListRenderer::$thematicBreak in /Applications/MAMP/htdocs/classes/class_guirenderer.php on line 184

Notice: Undefined property: ListRenderer::$thematicBreak in /Applications/MAMP/htdocs/classes/class_guirenderer.php on line 184

Notice: Undefined property: ListRenderer::$thematicBreak in /Applications/MAMP/htdocs/classes/class_guirenderer.php on line 184

Notice: Undefined property: ListRenderer::$thematicBreak in /Applications/MAMP/htdocs/classes/class_guirenderer.php on line 184

Notice: Undefined property: ListRenderer::$thematicBreak in /Applications/MAMP/htdocs/classes/class_guirenderer.php on line 184

Notice: Undefined property: ListRenderer::$thematicBreak in /Applications/MAMP/htdocs/classes/class_guirenderer.php on line 184

Notice: Undefined property: ListRenderer::$thematicBreak in /Applications/MAMP/htdocs/classes/class_guirenderer.php on line 184

Notice: Undefined property: ListRenderer::$thematicBreak in /Applications/MAMP/htdocs/classes/class_guirenderer.php on line 184

Notice: Undefined property: ListRenderer::$thematicBreak in /Applications/MAMP/htdocs/classes/class_guirenderer.php on line 184

Notice: Undefined property: ListRenderer::$thematicBreak in /Applications/MAMP/htdocs/classes/class_guirenderer.php on line 184

Notice: Undefined property: ListRenderer::$thematicBreak in /Applications/MAMP/htdocs/classes/class_guirenderer.php on line 184

Notice: Undefined property: ListRenderer::$thematicBreak in /Applications/MAMP/htdocs/classes/class_guirenderer.php on line 184

Notice: Undefined property: DocumentRenderer::$thematicBreak in /Applications/MAMP/htdocs/classes/class_guirenderer.php on line 184

Notice: Undefined property: DocumentRenderer::$thematicBreak in /Applications/MAMP/htdocs/classes/class_guirenderer.php on line 184

Notice: Undefined property: DocumentRenderer::$thematicBreak in /Applications/MAMP/htdocs/classes/class_guirenderer.php on line 184

Notice: Undefined property: DocumentRenderer::$thematicBreak in /Applications/MAMP/htdocs/classes/class_guirenderer.php on line 184

Notice: Undefined property: DocumentRenderer::$thematicBreak in /Applications/MAMP/htdocs/classes/class_guirenderer.php on line 184

Notice: Undefined property: DocumentRenderer::$thematicBreak in /Applications/MAMP/htdocs/classes/class_guirenderer.php on line 184

Notice: Undefined property: DocumentRenderer::$thematicBreak in /Applications/MAMP/htdocs/classes/class_guirenderer.php on line 184

Notice: Undefined property: DocumentRenderer::$thematicBreak in /Applications/MAMP/htdocs/classes/class_guirenderer.php on line 184

Notice: Undefined property: DocumentRenderer::$thematicBreak in /Applications/MAMP/htdocs/classes/class_guirenderer.php on line 184
 
Those are notices, not errors. There are no errors. Below that should be the page, try visiting another page, do you still get a 404 error?
 
When you visit another page, what's the URL in the bar look like?

It should be 127.0.0.1/login, not 127.0.0.1/login.php.

If it's going to anything with a .php extension, then MAMP is ignoring the .htaccess file. I found this article on potentially fixing this. Remember that after each change, you must restart the server to see the effects. I hope you've been doing that between each fix I've suggested?
 
Yes, I've been restarting the servers! :usedusedused:
Also, the URLs do not contain .php in the end or anything.
 
Now I'm 100% sure the url problems are due to my apache rewrite module... I've tried everything but I keep getting 404 errors! Please help :catfish:
 

Users who are viewing this thread

  • Forum Contains New Posts
  • Forum Contains No New Posts

Forum statistics

Threads
4,280
Messages
33,130
Members
1,603
Latest member
Monako
BETA

Latest Threads

Top