Jump to content

Recommended Posts

So after many different tutorials (since none just seem to be straight forward and even correct for that matter) I got Apache 2.0, Mysql and PHP, and PhpMyAdmin installed on my machine which runs Windows XP. My problem seems to be with pear I guess. (I really don't know.)

 

So one tutorial during setup said to make a PearTest.php and include the following:

 

<?php

require_once 'DB.php';
PEAR::setErrorHandling(PEAR_ERROR_DIE);

$db_host = 'localhost';
$db_user = 'root';
$db_pass = 'password';
$db_name = 'barracuda';
$dsn = "mysql://$db_user:$db_pass@unix+$db_host/$db_name";

$db = DB::connect($dsn);
$db->setFetchMode(DB_FETCHMODE_OBJECT);

?>

 

The problem is I have no DB.php anywhere even after installing PEAR. Since this is the first time Ive ever ran a server on my machine I'm not totally sure how things are done of course. I'm guessing that even if DB.php existed it couldn't just be called out of thin air with no path to where it is stored?

 

Anyway when I run that script I get this error:

 

Warning: require_once(DB.php) [function.require-once]: failed to open stream: No such file or directory in C:\www\Server\Apache2\htdocs\testpear.php on line 3

Fatal error: require_once() [function.require]: Failed opening required 'DB.php' (include_path='.;C:\www\Server\PHP\pear') in C:\www\Server\Apache2\htdocs\testpear.php on line 3

 

Furthermore I'm trying to install a free php directory script and when I try to pull up the programs installer I get unparsed php. Odd. I ran a phpinfo test and everything worked fine. Yes of course I got the Barracuda installer inside of htdocs. I cant figure it out please help! Heres the barracuda page I get when I run the index.php (basically an unparsed page to me) :

 

sessionStart(); /* *---------------------------------------------------------------- *---------------------------------------------------------------- *---------------------------------------------------------------- *-----------components allowing and including-------------------- *---------------------------------------------------------------- *---------------------------------------------------------------- *---------------------------------------------------------------- */ $gParams['location'] = $gParams['location'] ? $gParams['location'] : 'main'; is_user(); $gUser->set_permissions($gPermissions); $page_file = $gParams['root_dir'].'pages/_'.$gParams['location'].'_.php'; if(file_exists($page_file)) require_once($page_file); $gStatistics->set_user($gUser->id); // defines basic classes $base_classes = array('_menu_'); $g_allowed_array = get_allowed_components($gParams['location'], $gUser->permissions); $g_allowed_array['components'] = array_merge($base_classes, $g_allowed_array['components']); for(reset($g_allowed_array['actions']); list($key, $value) = each($g_allowed_array['actions']) if($gParams[$value] || $gParams[$value.'_x'] || $gParams[$value.'_y']) $gParams['action'] = $value; for(reset($g_allowed_array['extensions']); list($key, $value) = each($g_allowed_array['extensions']) require_once($gParams['ext_dir'].'ext_'.$value.'.php'); /* * execute users actions */ require_once('include_components.php'); require_once('actions.php'); Objects_create(); Objects_show(); /* *---------------------------------------------------------------- *---------------------------------------------------------------- *---------------------------------------------------------------- *---------------------------------------------------------------- *---------------------------------------------------------------- *---------------------------------------------------------------- *---------------------------------------------------------------- */ /* * set errors layout */ if($gErrors->hasErrors()) { $arr_err = $gErrors->getErrors(); $all_errors = ''; for($i=0;$ifill_template('error', 'message', $arr_err[$i]); $gLayout->add('errors', $all_errors); } if($gErrors->hasMessages()) { $arr_msg = $gErrors->getMessages(); $all_messages = ''; for($i=0;$ifill_template('message', 'message', $arr_msg[$i]); $gLayout->add('messages', $all_messages); } //Step 3. Output proccessing $gLayout->CONTENT['TITLE'] = $gParams['location'] == 'main' && $gParams['cat'] == 0 ? $gParams['root_title'] : get_title(); $gLayout->CONTENT['HOME'] = url($gParams['root_url'], array('cat' => '', 'srch_text' => '', 'srch_how' => '', 'action' => '')); if(!is_admin() && !is_member()) $gLayout->CONTENT['HOME'] = str_replace('?', '', $gLayout->CONTENT['HOME']); $gCss = ''; for(reset($gScript['css']); list($key, $value) = each($gScript['css']) $gCss .= $gLayout->fill_template('css', 'system', array('css' => $gParams['root_url'].'layout/'.$gParams['theme'].'/'.$value.'.css')); // registers global javascript variables register_global_js_vars(); $gLayout->CONTENT['CSS'] = $gCss; $gLayout->CONTENT['IMG'] = $gParams['system_pics_url']; $gLayout->CONTENT['HREF_NEW_LINKS'] = url('', array('cat' => 0, 'location' => 'new_links')); $gLayout->CONTENT['HREF_TOP_RATED_LINKS'] = url('', array('cat' => 0, 'location' => 'top_rated_links')); $gLayout->CONTENT['HREF_ADD_URL'] = url(get_param('script_url'), array('location' => 'link_add')); $gLayout->CONTENT['J_ADD_LINK'] = "go('".cut_url(url('', array('location' => 'link_add'), false))."'); return false;"; //$gLayout->CONTENT['PRODUCT_LOGO'] = getLinkBody("ad.php?a=link"); if(!get_param('cat')) { $location = get_param('location'); $search_bottom = array('new_links', 'top_rated_links'); if((array_search($location, $search_bottom) === false)) { //$gLayout->add('search_top', $gLayout->get('search')); //$gLayout->add('search', ''); } $gads_arr = array('new_links', 'top_rated_links'); if(!(array_search($location, $gads_arr) === false)); //$gLayout->CONTENT['GADS'] = $gLayout->fill_template('google_ads', '', array()); } else { if((!is_admin() && get_param('cat'))); //$gLayout->CONTENT['GADS'] = $gLayout->fill_template('google_ads', '', array()); } $gLayout->CONTENT['ROOT_URL'] = $gParams['home_page'] ? $gParams['home_page'] : $gParams['root_url']; $gLayout->CONTENT['SCRIPT_ROOT_URL'] = $gParams['root_url']; $gLayout->CONTENT['ROOT_DIR_URL'] = $gParams['root_url']; $gLayout->CONTENT['TOTAL_LINKS'] = $gQueries->get_objects_count_by_status(get_param('dir'), 'links', 1); $gLayout->CONTENT['TOTAL_CATEGORIES'] = $gQueries->get_objects_count_by_status(get_param('dir'), 'categories', 1); //$gLayout->CONTENT['PRODUCT_LOGO'] = &getLinkBody(); $gLayout->add('header', $gLayout->fill_template('header', '', $gLayout->CONTENT)); $gLayout->add('footer', $gLayout->fill_template('footer', '', $gLayout->CONTENT)); $gLayout->show_page('_page_'.$gParams['location']); mysql_close($gDb->link); ?>

 

Oh yeah heres my file structure:

 

C:\www\Server\Apache2

C:\www\Server\MySQL

C:\www\Server\PHP

 

Thanks in advance if anyone is able to help me. I greatly appreciate it! Thanks!

Link to comment
https://forums.phpfreaks.com/topic/85332-somethings-not-right-about-this-install/
Share on other sites

Sure! Thanks for responding. It output:

 

.;C:\www\Server\PHP\pear

 

So I went and looked in php.ini and found:

 

; Windows: "\path1;\path2"
include_path = ".;c:\www\Server\PHP\includes;c:\www\Server\PHP\PEAR"

 

Should this be changed?

 

Also I'm not sure if I should have an includes folder somewhere but I dont see one anywhere in PHP or PEAR's folder.

Well now I go inside of PEAR's folder and theres another PEAR folder.

 

C:\www\Server\PHP\PEAR\PEAR

 

Not sure if thats right, there are files and folders in both.

 

Also I wonder why the include path php code you had me run output the path as lowercase "pear" when its uppercase "PEAR".

 

(edit)

 

Now I just looked at the pear.ini and its referencing paths like: "C:\www\Server\PHP\pear" when the path is "C:\www\Server\PHP\PEAR"

 

maybe thats it?

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.