I created a project and a controller called about.
But I dont know how to navigate from the controller to my webpage...
Even when I write the url, the website doesnt appear :(
http://localhost/dev.gamenomad.com/About
default url structure http://host/controller/action, I'm familiar with this book so assuming everything is properly setup try http://localhost/dev.gamenomad.com/about/contact the url you're calling will by default load the indexAction and I don't think you have one yet.
Also in your netbeans right click on your project name, then at the bottom of the menu select properties, then in the left pane select 'Run Configuration'. Now make sure your Project url is correct and if you have specified an Index file make sure it points to public/Index.php (usually when using Zend Framework I don't specify an Index file)
Now if you still have issues go through the checklist:
mod_rewrite enabled in httpd.conf (or in .htaccess)
vhost setup and enabled if using one
make sure there is an .htaccess in your /public folder (put there by Zend_Tool when building app).
you're not using Internet Explorer (This browser give strange behavior, especially for newbies)
enable development mode or changed all the 0 in your application.ini to 1
Related
I've got a legacy PHP project to fix a thing or two. I've downloaded it via FileZilla and served it on my local machine with a local copy of the database. The project is exactly the same with the live one, yet the live one can open the url/contact.html but on my machine it says no such file is found. All other pages go for url/categories/ or url/products/ so I've tried altering the url but no use.
All the other pages within the site are simple: one .php controller one .php model and one .tpl smarty template view. Requiring no .html at all. But this one is somehow different. The .htaccess file is exactly the same as the live version. I've tried adding a rewrite rule to direct every .html to .php but didn't work. I'm lost and out of options, please help? It doesn't even have to be an answer,"Try looking into that" would work too.
I'm working via XAMPP on windows, and I've configured the https:// to http:// on my project but that's all. Even hidden files are checked and confirmed.
have checked that contact.html is a static file (like a real existing html file?)
is there some kind of "routing" within the PHP of the project? If there is route urls might be really anyware.. in the mysql database, redis, a json file and whatnot.. have seen them all.
try to debug where and how it works on the "production" server by using some logging to a file edit the file through filezilla and log to a 'mylog.log' file until you find out what is going on.. or if the site is not used all the time by clients - you can just try to echo stuff to figure out how this exact /contact.html works
I am having trouble when navigating through some pages because when clicking on a menu item it goes to
http://localhost/drupal/admin/structure
and its giving me this error
The requested URL was not found on this server.
but if I manually added index.php after the site name
http://localhost/drupal/index.php/admin/structure
It does work. How could I solve this issue?
Looks like you don't have enabled apache server rewrite engine (or alternative if you have some other web server). To use aliases it has to be working.
If it is enabled check if you have .htaccess file in webroot dir. If you copied your files from somewhere it could happen that hidden files (those starting with dot) are not copied.
A friend of mine asked me for a favour, to move his website. The programmer who made it, send me an archive with the database, and the rest of the files needed. I've installed it on my localhost, with apache, php and mysql installed on it.
I have a problem with it. If I go to localhost/mgro/index2.php, it shows somehow a minimal version of the website, but if I click on something, it gets to index.php?something_else_here and it works. If I go to localhost/mgro I just see the files, and if I go to localhost/mgro/index.php it redirects me to localhost/mgro.
About the configuration file, I've used the configuration.php-dist file, with new info in it. What I've changed was just the database, user and password for the database.
Basically, everything works fine, except that index.php with no requests, because it "backs" me into the folder
NEW PROBLEM: If I click on an Add to cart button, it redirects me to the website that is online.
Is this Joomla 1.5 or Joomla 2.5.x / 3.0? I'm going to guess that you have a potential issue with the live_site variable in the configuration.php file, especially if you're using Joomla 1.5. Make sure that it is configured to your localhost's live site URL directory.
Some other things to check:
1) If you're using SEF urls you need to use a .htaccess file. Usually the one Joomla' includes by default works (if you don't have it you can redownload it from Joomla's code repos: http://joomlacode.org/gf/project/joomla/frs/?action=index
2) When logged in go to global configuration and check the option "URL rewriting". You can try switching it off. (On does require the .htaccess file mentioned before).
3) If you're just seeing files when you hit the directory then Apache isn't configured to load .php files. Since you're running a localhost you'll have to track that down somehow.
Some other notes:
-Index2.php isn't anything, don't use it.
For some reason when I create a project in netbeans and go to run the project it also loads the xxamp index file and not the project index file that is apart of the codeigniter installation.
http://screencast.com/t/qOSH80wPgvf
Edit:
Here is my file tree I have right now set up for my project. Why Netbeans creates an important files folder I have no idea for my CI project. I have edited the index file to have the application and system variable to both have the ../system or applicaton as its value. I have changed the Web Root inside the project properties to have a value of public_html and I have also changed the value of the Index File field to say index.php.
After doing this and running the project I would expect to get the default Welcome to Codeigniter page and I don't. I am receiving a message that shows the following. Any ideas on why this is?
Object not found!
The requested URL was not found on this server. If you entered the URL manually please check your spelling and try again.
If you think this is a server error, please contact the webmaster.
Error 404
localhost
Apache/2.4.4 (Win32) OpenSSL/0.9.8y PHP/5.4.16
Projects
- MyFirstProject
- Source Files
- application
- public_html
- assets
index.php
- system
- Test Files
- Important Files
- Include Path
I've tried doing some additional research on the topic and have yet to come up with a solution.
Edit 2:
Any ideas from anyone?
Your problem is likely related to your choice of folder layout. Which I assume you do, for "security reasons". That said, NetBeans isn't a server. Its an IDE, so you can't manipulate it the same way you would the server.
Most servers by default define your "root" folder as "public_html" or "www" as far as where it looks by default to serve files for public consumption. Through the use of PHP you can tell the index.php that comes with CodeIgniter to look up one directory outside of the defined root and have it read the file(s) accordingly.
However, to setup a project in netbeans and have all files and folder accounted for accordingly you need to tell it that all your files start in whatever folder they reside. So it can load all the files and read from them respectively. This in essence and in respect to server logic is telling it that the folder that houses
application
public_html
system
is the define root path. So inadvertantly by breaking out of the design of codeigniter and placing the core files outside of what would be your defined root on the server is breaking your project. There is not an index.php depicted in your listing above at the same level that those folders are in. If there is, its the index.php for xxamp that keeps loading for you by default.
What you need to do is stop trying to implement your "security measures" and put them in the right order. Or.. not include that folder in your project telling it the one with assets and index.php is the root path. If netbeans is smart enough it will find the files and folders outside like the server will.
Right click on your project and go to properties. Make sure that in the run configuration the URL is correct and the index file is properly set up and matches your directory in xxamp.
after downloading codeigniter open index.php file and there set your path correctly to your
application folder because i think you putted your index.php inside public_html folder so
the path which is set by default in index.php is not working and can not find application folder, try to fix it and it will work fine your problem is not with netbeans.
Using CakePHP 1.3, I have the following layout:
/srv/www/_cakephp13/
/app/
/cake/
/plugins/
/vendors/
etc...
/srv/www/htdocs/
/cake_app/
/other-dir/
... where htdocs is the public directory, and I have moved webroot of my app to be cake_app above... Which appears to be almost working. (After customizing webroot's index.php).
When I access http://devserver/cake_app/, I am able to see the default "Home" page controller/view (which I have customized, so that appears to be working).
But when I access http://devserver/cake_app/controller/view I am receiving 404 errors.
Is is possible to run a Cake App in a sub-directory of a site root? How can I get this working?
Ideally, I don't want to edit Apache conf's... If I can fix this with Cake configuration or htaccess files, I'll be much happier.
You should verify that .htaccess is being run and that the rewrite module is on and working.
You will need to have mod_rewrite enabled on Apache. To check if it's on, make a page that just does this:
echo phpinfo():
Grep on the text "loaded modules". Make sure mod_rewrite is listed there. If it's not, you can either add it to apache's configuration, or you may need to install it (depending on your original installation method and whether you included that module).
If you can't get mod_rewrite running, you can still use cake without it (the URL will just look like index.php/controller/action/etc). Check out http://book.cakephp.org/view/333/A-Note-on-mod_rewrite for more info. Specifically,
If you don't want or can't get
mod_rewrite (or some other compatible
module) up and running on your server,
you'll need to use Cake's built in
pretty URLs. In /app/config/core.php,
uncomment the line that looks like:
Configure::write('App.baseUrl',
env('SCRIPT_NAME'));