Welcome Guest, Not a member yet? Register   Sign In
Please help, having trouble setting up development environment with MAMP using Mac OS X
#1

[eluser]shibuya[/eluser]
Hi.

I'm reading up on developing a web application and the development setup are the following:


Mac OS X
MAMP 1.7.1 (Apache, MySQL, PHP5)

MAMP preferences uses default apache and mysql ports,

I have it set up in VirtualHost so that I can access it on my browser using http://phpweb20/ with my document root being /Users/username/Sites

The filesystem structure is:
Code:
/
|- /data
| |- /logs
| |- /uploaded-files
| |- /tmp
|- /htdocs
|- /include
| |- /Controllers
|- /templates

Just to test to see if everything is working, I created a Class Controller called NewsController.php inside the /phpweb20/inlclude/Controllers

After that, created a php file named NewsController.php and placed it inside the directory (folder) /phpweb20/include/Controllers
Code:
<?php
    require_once('Zend/Loader.php');
    Zend_Loader::registerAutoload();

    $controller = Zend_Controller_Front::getInstance();
    $controller->setControllerDirectory('../include/Controllers');
    $controller->dispatch();

?>

However, I keep getting this error message when accessing the Controller and Action following this URL http://phpweb20/news/display
Code:
Warning: require_once(Zend/Loader.php) [function.require-once]: failed to open stream: No such file or directory in /Users/valuedcustomer/Sites/phpweb20/htdocs/index.php on line 2

Fatal error: require_once() [function.require]: Failed opening required 'Zend/Loader.php' (include_path='.:/Applications/MAMP/bin/php5/lib/php') in /Users/valuedcustomer/Sites/phpweb20/htdocs/index.php on line 2

I'm not sure what I'm doing wrong. I'm sure I setup the web development server correctly. The book tells me that I should see the text "News article details" output inside my browser but I keep getting that error.

This book is the Practical Web 2.0 Application with PHP from Apress.

Please help me setup the testing environment correctly. Thank you so much.
#2

[eluser]philm[/eluser]
I have a simlar setup to that working ok, however I have CI setup in the default MAMP location, eg.

User -> Application -> MAMP -> htdocs -> codeignitor.

Maybe try it without the Virtualhost stuff?
#3

[eluser]Phil Sturgeon[/eluser]
Well I presume Zend/Load.php isnt in Controllers? Either way give it a full path to use. Combine APPPATH or BASEDIR and give it a proper location to chew on, then see if that works.
#4

[eluser]shibuya[/eluser]
[quote author="philm" date="1199990938"]I have a simlar setup to that working ok, however I have CI setup in the default MAMP location, eg.

User -> Application -> MAMP -> htdocs -> codeignitor.

Maybe try it without the Virtualhost stuff?[/quote]

Hi.

I use Sites to prevent any of my files being overwritten in case I have to upgrade MAMP in the future. However, I may try installing it directly inside MAMP to see if that'll work.
#5

[eluser]shibuya[/eluser]
[quote author="thepyromaniac" date="1199991812"]Well I presume Zend/Load.php isnt in Controllers? Either way give it a full path to use. Combine APPPATH or BASEDIR and give it a proper location to chew on, then see if that works.[/quote]

I placed it inside the include folder in the directory. The Zend library is in there.
#6

[eluser]shibuya[/eluser]
What would be MAMP equivalent to /var/www/phpweb20/htdocs in Apache Linux server
#7

[eluser]shibuya[/eluser]
I've tried both method and it still doesn't recognize it.

Anybody else reviewd the book Web 2.0 Applications with PHP by Apress? I think the installation chapter is written too vague but I want to know if others agree.
#8

[eluser]swanky[/eluser]
Did you ever get it setup?

swanky




Theme © iAndrew 2016 - Forum software by © MyBB