|
|||||||
New to SitePoint Forums? Register here for free!
|
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
SitePoint Member
Join Date: Oct 2006
Posts: 24
|
I was looking at an article about how one can achieve a good structured PHP MySql website with CakePhp. So I started to see what CakePhp was all about. I followed the instructions the article suggested to use, however I am unable to make the header appear. I get an error message that states:
Warning: session_start() [function.session-start]: Cannot send session cookie - headers already sent by (output started at c:\webs\test\cake\app\config\database.php:75) in c:\webs\test\cake\cake\libs\session.php on line 132 Warning: session_start() [function.session-start]: Cannot send session cache limiter - headers already sent (output started at c:\webs\test\cake\app\config\database.php:75) in c:\webs\test\cake\cake\libs\session.php on line 132 Warning: Cannot modify header information - headers already sent by (output started at c:\webs\test\cake\app\config\database.php:75) in c:\webs\test\cake\cake\libs\session.php on line 133 However, I have the statements: Your database configuration file is present. Cake is able to connect to the database. The css file seems to work except for the background, and images. My configuration is WAMP Apache 2.2.3, PHP Version 5.1.6, MySql 5.0.22, with the document root set to "C:/webs/test/" Where I then put Cake in the test folder. I have this as the directory: <Directory "C:/webs/test"> made sure that this was changed from none to all: AllowOverride All and uncommented LoadModule rewrite_module modules/mod_rewrite.so and yet I still have problems with this configuration. Is there something that I am missing? .thtml is a file type but I am unsure how to make it a file type. I don't know if this is my problem but I am sure that it may be. I am new at this program, as you can tell, and yet I am hopeful that I can use it to see if this will be a good place to make the scripts in PHP more secure and allow for a good markup. Could someone please help me on this? Apache 2.2.3 is a lot different from it's predecessor and I had to work out a great deal of problems with it's initial setup. If anyone could help me with this I would be greatful. Thanks, KnightsPrayer |
|
|
|
|
|
#2 |
|
SitePoint Mentor
![]() ![]() Join Date: Nov 2005
Posts: 2,505
|
You have fouled up the code by sending heading information after out has been send. Actually, for a quick fix you can do away with this by adding ob_start() at the top of the page. But because CakePHP is a MVC framework it could be confusing to decide where to put that line of code. I used CakePHP a few months ago and i followed exact instructions at http://www.sitepoint.com/article/app...opment-cakephp and it had worked like a charm for me. So would you mind going through the article.
Apache 2.2.3 is problematic with PHP 5.0.x or 5.1.x . You need 5.2 for that to work which is not officially out as of now. However, may be WAMP fixes it up in someway else the script wouldn't work in the first place. Nonetheless, this thread could be useful. |
|
|
|
|
|
#3 | |
|
SitePoint Mentor
![]() ![]() Join Date: Nov 2005
Posts: 2,505
|
Quote:
|
|
|
|
|
|
|
#4 |
|
SitePoint Wizard
![]() Join Date: Mar 2006
Posts: 6,132
|
you cannot send output before sending headers. session_start() sends headers.
php has told you where the output was sent, including which file, and which line. c:\webs\test\cake\app\config\database.php:75 to me it sounds like you modified the file to produce some output. output can be defined as text, html, or even whitespace characters. so yes, a space or blank new line is "output". it doesnt matter if the output comes from inside <?php ?> or not. its still output. fix your problem on line 75. |
|
|
|
|
|
#5 | |
|
SitePoint Member
Join Date: Oct 2006
Posts: 24
|
Quote:
Here was the solution that worked with my installation. If you look in the comments you will see a comment by Snaps11 on how to deal with a work around so that Apache executes the .dll you are talking about without having to put it in the httpd.conf file. http://www.tanguay.info/wamp/installPhp5.php5 My configuration works for everything that I have tried on it. There is just something about the htaccess file that wont work. I did read the sitepoint colum that discusses this topic, that is why I decided to try and install it. Seems promising. What did you think of it? Do you still use it or did you find it limiting or something else. Would really like to know. Inquiring minds Anything else it could be would be helpful. Thanks for your attention to my question. KnightsPrayer |
|
|
|
|
|
|
#6 | |
|
SitePoint Member
Join Date: Oct 2006
Posts: 24
|
Quote:
|
|
|
|
|
|
|
#7 | |
|
SitePoint Member
Join Date: Oct 2006
Posts: 24
|
Quote:
|
|
|
|
|
|
|
#8 |
|
SitePoint Member
Join Date: Oct 2006
Posts: 24
|
Does anyone know why I only get This as the header for CakePhp:
CakePHP Rapid Development Your database configuration file is present. Cake is able to connect to the database and why I do not get the Icon for CakePhp? Along with the background color. Is this something that I am supposed to define myself? When I look at the source of the document I see that the Icon is called but for some reason it is not executed. This is what I see at the top of the document and then it calls for the css file after this which does execute fine along with the Div. <title>CakePHP : Home</title> <link rel="icon" href="/cake/favicon.ico" type="image/x-icon" /> <link rel="shortcut icon" href="/cake/favicon.ico" type="image/x-icon" /> Just curious if I am installing this correctly or not. When I look at the sitepoint column listed above, I see the CakePhp logo, yet I do not see it on the page that I get when I have installed it. Any help would be appreciated. KnightsPrayer |
|
|
|
|
|
#9 |
|
Sell crazy someplace else
![]() ![]() ![]() ![]() ![]() ![]() Join Date: Aug 2003
Location: Manchester, UK
Posts: 4,038
|
What you are seeing is correct. Maybe previous versions produced the output that Sitepoint shows but the latest version(s) show what you are seeing.
|
|
|
|
|
|
#10 |
|
SitePoint Guru
![]() ![]() ![]() ![]() ![]() Join Date: Aug 2006
Posts: 601
|
I have recently configured cake myself, and yes, that's what it should show you. I would suggest reading the manual (cakephp.org) and click manual.
|
|
|
|
|
|
#11 |
|
Are You There?
![]() ![]() ![]() ![]() ![]() ![]() Join Date: Oct 2003
Location: Your Monitor
Posts: 1,155
|
You guys are right... Didn't do enough reading up.
Thanks! |
|
|
|
|
|
#12 | |
|
SitePoint Member
Join Date: Oct 2006
Posts: 24
|
Quote:
KnightsPrayer |
|
|
|
|
|
|
#13 | |
|
SitePoint Member
Join Date: Oct 2006
Posts: 24
|
Quote:
KnightsPrayer ![]() |
|
|
|
|
|
|
#14 | |
|
SitePoint Member
Join Date: Oct 2006
Posts: 24
|
Quote:
|
|
|
|
|
|
|
#15 |
|
SitePoint Guru
![]() ![]() ![]() ![]() ![]() Join Date: Aug 2006
Posts: 601
|
I hope you enjoy cakePHP, it takes some experience to get used to it, but once you get the hang of it it's quite nice. I, personally, used to be concerned about weather or not my app would work. Now I am actually concerned about usability and design. It really makes mysql simpler so you can focus on making the best program you can.
Happy coding! |
|
|
|
|
|
#16 | |
|
SitePoint Member
Join Date: Oct 2006
Posts: 24
|
Quote:
ScriptAlias /php/ "c:/php/" AddType application/x-httpd-php .php .php5 .thtml Action application/x-httpd-php "/php/php-cgi.exe" SetEnv PHPRC "C:/php" or do I use an AddType application/cake .thtml Or do I not need to address this because I have the following in the httpd.conf DefaultType text/plain or do I add it to the ??????????? I don't even know if I need to use if if I have the DefaultType as explained above. Could you elaborate if you Know??? |
|
|
|
|
|
|
#17 |
|
Sell crazy someplace else
![]() ![]() ![]() ![]() ![]() ![]() Join Date: Aug 2003
Location: Manchester, UK
Posts: 4,038
|
You don't need to worry about the .thtml extension as you never access those files directly in the browser using cakePHP (/foo/bar for example, never /foo/bar/whatever.thtml). The only place you might want to address it is with your editor, making the .thtml files highlight as .html would be.
|
|
|
|
|
|
#18 |
|
Are You There?
![]() ![]() ![]() ![]() ![]() ![]() Join Date: Oct 2003
Location: Your Monitor
Posts: 1,155
|
Questions.... How come when I access Cake at http://localhost/caketest I get a 400 Bad Request Error, but when I access it at http://localhost/caketest/ it loads fine?
|
|
|
|
|
|
#19 | |
|
Sell crazy someplace else
![]() ![]() ![]() ![]() ![]() ![]() Join Date: Aug 2003
Location: Manchester, UK
Posts: 4,038
|
Quote:
|
|
|
|
|
|
|
#20 |
|
Are You There?
![]() ![]() ![]() ![]() ![]() ![]() Join Date: Oct 2003
Location: Your Monitor
Posts: 1,155
|
Sure does! Thanks!
|
|
|
|
|
|
#21 | |
|
SitePoint Member
Join Date: Oct 2006
Posts: 24
|
Quote:
KnightsPrayer |
|
|
|
|
|
|
#22 | |
|
Sell crazy someplace else
![]() ![]() ![]() ![]() ![]() ![]() Join Date: Aug 2003
Location: Manchester, UK
Posts: 4,038
|
Quote:
|
|
|
|
|
|
|
#23 |
|
SitePoint Guru
![]() ![]() ![]() ![]() ![]() Join Date: Aug 2006
Posts: 601
|
Thanks markl999, I was having that problem too.
|
|
|
|
![]() |
| Bookmarks |
«
Previous Thread
|
Next Thread
»
| Thread Tools | |
| Display Modes | |
|
|
|
All times are GMT -7. The time now is 18:56.











Linear Mode
