Posts Tagged ‘configure’

Clean URLs in PHP Yii Framework

Wednesday, November 18th, 2009

Here is a quick tip to save some trouble. The goal here is to get clean urls like http://localhost/site/test/5 or http://localhost/site/contact without having a query string variable and also not having the filename index.php show up.

My configuration:
EasyPHP (apache/php/mysql combo for windows)
Yii PHP framework

In the Yii main.php configuration file you need:

'urlManager'=>array(
    'urlFormat'=>'path',
    'showScriptName'=>false,
),

Inside the ‘components’ array area.

In the primary directory where the index.php file is you need a .htaccess files with this in it:

Options +FollowSymLinks
IndexIgnore */*
RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . index.php

If you have problems, check your httpd.conf file for these items:
<directory c:\easyphp\www>
Inside that directory section, make sure the rules don’t disallow the removal of index.php or the other rewrite rules.

Make sure this line is un-commented:
LoadModule rewrite_module modules/mod_rewrite.so

I think that’s about it…

Setting Up Netbeans and Ruby

Saturday, November 14th, 2009

I’ve been considering some development with Ruby and Rails. As I’ve used the Netbeans IDE before and liked it, I downloaded the Ruby version to give it a try.

The main benefit here is that you can do a lot of things without the console. I can add models, scaffolds, migrate databases, and such with a few clicks.

The current default install doesn’t have the most current version of “JRuby” (that being ruby created with 100% Java) installed, so I opted to figure out how to update Netbeans with the most current interpreter.

Here is a quick list of things to do:
download the Ruby Netbeans IDE

Download latest version of JRuby

Install the new version to:
C:\Program Files\NetBeans 6.7.1\ruby2\
Depending on your install directory of Netbeans.

A directory will be created: jruby-1.4.0
Depending on the currently available version of JRuby.

In Netbeans, go to the platform manager in the menu “tools >> Ruby Platforms”: Select auto-detect platforms, or add a platform and browse to:
C:\Program Files\NetBeans 6.7.1\ruby2\jruby-1.4.0\bin\jruby.exe
This links the newly installed one with the IDE.

When creating your first project, one of the wizard steps will have a “install rails” button, click that and allow it to download and install rails for the new version of JRuby you just added. Currently that would be version 2.3.4.

Install the “activerecord-jdbcsqlite3-adapter” ruby gem through the menu item “tools >> ruby gems” if you are interested in using the sqlite database engine.
(in your database.yml file make development and test use… adapter: jdbcsqlite3 instead of sqlite3)

Change the server used to Webrick when creating a project, in one of the wizard steps (much much faster than that glassfish one) .

That’s about it to get started. I’ve started playing around with creating models and scaffolding, but I have yet to do anything worth while. I think I need to read up on the Ruby language itself to get the basic syntax down.

Edit:
I started reading and tinkering with some code for a few days.
I’m not too impressed with Ruby/Ruby on rails so far. It doesn’t seem any easier than any other language to use. It seems more like jumping through predefined hoops to get anywhere. It has some great ideas in it like parts of the data model and the ruby syntax itself. I might give it a try again sometime, but for now it is likely I will try a PHP/framework combo instead.

Getting ASP With JET Access Working On 64-bit vista

Sunday, December 28th, 2008

There are quite a few issues in getting classic asp scripts working on vista. I want to quickly go over what I did, so that when I need this information available in the future I have an easy place to find it. So to save time I am just trying to get this written as fast as possible and continue on with my work. Sorry for any typos.

Install IIS through control panel -> programs and features -> (left panel) “turn windows features on or off”

Once the feature listing window populates:
expand the “internet information services” item
check web management tools and world wide web services
…really I went through the options and selected the majority of them.
Key ASP related items to make sure you have selected:
“world wide web services” -> “application development features” -> ASP

I needed windows authentication, so I needed:
“world wide web services” -> “sercurity” -> “windows authentication”

After that, I had issues when trying to read access database files with JET. The main issue here is that a 64-bit driver does not exist. So we need to change the webserver to allow 32-bit software to run. I found generally how to fix this here.

That link above didn’t exactly work for me though. It was probably done with a slightly older or newer version of IIS that I have installed.

Start up the IIS control panel by going to “control panel” -> “administrative tools” -> “Internet information services manager”

First, select the “application pools” item in the left panel. If you only have one application pool (displayed in the middle window after selecting “application pools”), then you should add a new one called something like “classic 32-bit asp application pool.” Mine came with a “classic .net app pool,” which I used.

click on the pool that you want to make 32-bit. From the right-most panel you should see an option for “set application pool defaults…” Inside the window that pops-up change the option “enable 32-bit applications” to TRUE.

Next, we need to change our site to use that pool. Select “sites” from the left-most panel. Select “default website” or whatever site you want to assign. Then select “basic settings…” from the right-most panel. the pop-up will have a button labeled “select” for application pools. Click that and select our 32-bit pool.

Now you should be able to develop classic ASP sites that use MS Access database files. Just make sure you have the Jet access database drivers installed. If not, do a search on “MDAC” (Microsoft Data Access Components) or maybe “JET Access Driver” on microsoft.com and find the drivers to install.

This website showed how to enable error displaying to the web browser:
%windir%\system32\inetsrv\appcmd set config -section:asp -scriptErrorSentToBrowser:true

Run that command in a command prompt that has administration abilities. If you don’t do that, you will just get a generic error message when something doesn’t run in the script.




The Way Of Coding



 
Scott J. Waldron Photography
Stock Photo Website
Tech Learning Site
Follow me on Twitter

Popular Article Tags

Archives

Pages