Address of yii applications - php

I a new in Ubuntu and PHP frameworks. I had read the book about Yii name "Agile web application development with yii and php 5".
And this is the part of text:
Yii comes with a simple requirement checking tool. To invoke
the tool and have it verify the requirements for your installation, simply point
your browser to:
http://yourhostname/path/to/yii/requirements/index.php
I installed yii in /var/www/html/yii directory.
When I trying to open http://localhost/var/www/html/yii/requirements/index.php I get error message: Oops! This link appears to be broken.
Thanks for any help!

It depends on what your Apache server's "webroot" (localhost) is.
If your webroot is /var/www/html then el chief's answer would work:
http://localhost/yii/requirements/index.php
But your webroot is /var/www then you need to include the html part too:
http://localhost/html/yii/requirements/index.php
Basically "localhost" = /some/path (your Apache webroot), and when you are writing your URL you can just substitute the two.
So if "localhost" = /var/www instead of writing http://var/www/index.php you just write http://localhost/index.php
I hope this helps you with a higher-level understanding of what is going on.

This might help somebody, even though the question is already answered, since I had come searching here, even though the underlying issue was different.
I made the dumb mistake of extracting the downloaded yii archive into the www directory and accessing it via the http://localhost/yii/ URL, but took a while to realise that the extracted directory has the build#-release#, and once renamed to just "yii", things worked. Like I said, the problem you faced was different, but symptom was somewhat similar.

it should be http://localhost/yii/requirements/index.php

Also be aware that this book, while helpful, seems to have been rushed to publication. There's many fixes to be found on the Yii forums. I suggest you keep a tab open whenever you come across something that doesn't work or doesn't seem "right" in the book.

Related

How to create an index-file for Xampp

I apologize in advance if this issue has been posted before. My problem is that my programmer had to bail on my project due to personal reasons and left me alone with a 95% finished site. I have some basic experience with ASP classic but PHP is fairly new to me.
FireFTP scr_shot: https://www.dropbox.com/s/9lws1u0sl8k93rg/fireftp_scr_shot.jpg
To shorten it up; (with Xampp installed) I have downloaded my site to the hard-drive and is now trying to get it work on 'localhost'. Immediately I sense the absence of an index-file.
Do I need to make one myself for the use in localhost? In that case, what am I looking for?
Thank you in advance.
First if you want to make an index-file of your current website, you have to put all your pages in a folder in
xampp/htdocs/
e.g
C:\Xampp\htdocs\mywebsite
then after you make a directory just visit the url like this:
localhost/mywebsite
, remember to put an index file inside the mywebsite folder.
It turned out that there was a MYSQL-database behind the site which I had no idea about or any knowledge of how to get around.
I had the database taken off and written the code into the site-files.
Afterwards everything worked as laid out above comments.

Recess framework: Why am I getting a resource not found error when the file exists?

I'm thinking of using the Recess Framework which I downloaded as-is and followed the instructions studiously.
I'm using it with PHP (which is not the issue) and I seem to have it up and running... however I suspected something was slightly wrong with the pages being served (they did not contain the expected logos) so I inspected the code only to find out that the frameworks javascript and CSS files were "resource not found".
Incidentally the files exist at the path specified, and it's not a question that permissions are not set correctly - I checked that too.
But... I'm new to using "routing" through URLs as part of a MVC style and wondered if basically it has something to do with that.
If you download the framework, you'll find that the css and javascript files that make things look pretty, and activate certain parts of the framework toolset exists at the path:
http://localhost/yourRecessFolderName/index.php/recess/recess/apps/tools/public/js/shCore.js
but I get the dreaded 404 resource not found and this is preventing recess tools from working properly.
1) Has any body else had this or a similar problem?
2) What are the likely causes - help by pointing me in the right direction, unless you know the answer of course
On Recess v0.2, there is an .htaccess file in /apps that prevents direct access to children. You'd need to modify the .htaccess or configure something custom in mod_rewrite to allow the public folders under apps to be seen.
Well, seemed to fix it by downloading the most recent ("latest edge") version of the Recess framework from https://github.com/recess/recess
Everything seems to work fine now... hmm 0.o
When pass from Development to Production, the Recess Framework use a Cache for accelerate access to site. Is possible, in your case, that the cache content is wrong.
I suggest you access path /your/recess/path/data/temp and remove the files recess.php and sqlite-cache.db and try again.
I hope this help you.

Need to manipulate my url

I'm literally just starting to throw a site together today, so I don't even have much to work with yet, but I wanted to throw this out there so I'll have the information when I get there. I'm using WAMP (not sure which version, but downloaded within the last 6 months) and CodeIgniter 2.0.3. How do you manipulate the URL to do the following:
www.mysite.com/forums ==> forums.mysite.com
www.mysite.com/pc ==> pc.mysite.com
...
Would this be something that gets done with the htaccess file or some other way? And if it is the htaccess file, can someone provide specifics? I've looked into some sites that try to explain the htaccess file and they just confuse the crap out of me. :) lol. Oh yeah, and how will that look while looking at it on my local host? Currently my url looks like:
localhost/nothingbutcards/
Thank you all very much, hope you're enjoying your weekend.
Along with the reference material provided, the below should be a good starting point. It's an HTACCESS approach.
http://terriswallow.com/weblog/2008/htaccess-redirect-a-directory-to-a-subdomain-and-force-www/
I also wanted to mention, some web hosts now have this as an option in the configuration panel. Mine does, so I can go in, specify a subdomain and the path on the site it points to, and I'm done.

PHPStorm Namespace support not working for Symfony2 projects

I'm evaluating PHPStorm right now, and I've really grown fond of it. It's fast, has more or less everything perfectly implemented and the flow flows like a breeze...
The only thing bugging me (and that's a big one) is, that it doesn't seem to get the namespaces for my symfony2 project right.
See, in Netbeans, when I type use Symf[CTRL+SPACE] it show me all the Symfony namespaces, right out of the /vendors folder.
If I do the same in PHPStorm, no namesapces are shown. That means that the whole code copletion doesn't work for the vendor libraries, which is really very, very bad in terms of easy and fast programming.
Now, I'm quite sure that I'm just missing a setting somewhere, but I just can't find it.
The Question is a bit old, but if anyone stumbles across it (like me) and still nothing works, it might be because your vendor folder gets excluded from code inspection.
You have to go to "File -> Settings -> Directories" and set the vendor folder to be a resource root and not be excluded.
More info here: Jetbrains Namespaces
This is not an issue anymore, there is a Symfony plugin that works most of the time now.
Looks like a known issue in PhpStorm.

How do I ensure Symfony url_for() includes the PHP filename?

I've been battling to set up my Symfony project on a IIS web server, but have got it pretty much working.
I still can't get the nice URLs working though. When I use my dev environment, url_for generates URLs that look like .../frontend_dev.php/booking/create and everything works fine. But as soon as I use the prod environment url_for generates URLs that look like .../booking/create, which don't work presumably because of problems with the rewrite setup on IIS.
I don't want to try and get the proper rewrite working on IIS - I've stuffed around with that for ages now and have given up. If you have a silver bullet to fix my problem then I'd love to know but that's not really what the question is about.
I've found that calling .../index.php/booking/create works fine. Therefore I can fix my problem simply by ensuring that url_for always adds the filename. But how can I do this? I thought it might be just assuming index.php, so I made a copy called frontend.php but it still generates nice URLs, without the filename. It seems that if it's the dev environment, it adds the file, but if it's the prod environment, it hides it. Any ideas on how to override this?
In apps/appname/config/settings.yml, set no_script_name to false.
See the symfony Reference Book.

Categories