PDA

Archiv verlassen und diese Seite im Standarddesign anzeigen : HOW DO I INSTALL PHPIDS?



pcolomes
14.06.2007, 06:40
Hi. I have a website (www.something.com) and i have uploaded PHPIDS in www.something.com/ids/
When I try to open any file there are many errors like this:

Parse error: syntax error, unexpected T_STRING, expecting T_OLD_FUNCTION or T_FUNCTION or T_VAR or '}' in /home/****/public_html/ids/lib/IDS/Converter.php on line 34

HOW DO I CONFIGURE IT OR INSTALL IT?

On "doc" directory there are only some examples, nothing else.

Thanks

lars
14.06.2007, 08:03
PHPIDS is written in PHP5, using the PHP5 OOP features. The simple reason for your parser error is, that you actually using PHP4. So upgrading would help.

.mario
14.06.2007, 08:36
Hi pcolomes! Welcome to the forum.

First of all you should have PHP 5.2+ installed - it will also work with PHP 5.1.x but then you have to remove the native typehinting. The error you describe should come from the static call of the UTF7 converter - try to remove either public or static - should work then.

btw: We are working on an FAQ at the moment - including more examples and best practices.

Greetings,
.mario

bgaylor
13.02.2008, 20:12
Posted By: .marioHi pcolomes! Welcome to the forum.

First of all you should have PHP 5.2+ installed - it will also work with PHP 5.1.x but then you have to remove the native typehinting. The error you describe should come from the static call of the UTF7 converter - try to remove either public or static - should work then.

btw: We are working on an FAQ at the moment - including more examples and best practices.

Greetings,
.mario
So you didn't even answer his question...

The instructions on example.php aren't detailed at all...

I see:
// set the include path properly for PHPIDS
in the example.php. Do I need to copy the entire phpids folder to my application directory or just the lib/ids directory?
This has no initial instruction for what to use and what not to have. I don't want the extra cakePHP or any unused files laying in my directory. Maybe better documentation should be provided before telling a user adequate documentation is available.

bgaylor
13.02.2008, 20:31
After blindly figuring out that the lib/IDS might need go in the webserver root (thanks to the docs), I get this error when running the sample:
An error occured: Given file does not exist. Please make sure the logfile is present in the given directory.

.mario
13.02.2008, 23:39
Hi bgaylor,

the example.php is full of code and comments on how to install the PHPIDS and to be honest it answers all of your questions.


Do I need to copy the entire phpids folder to my application directory or just the lib/ids directory?
Why would you think it's necessary to have either the tests and the docs inside the webroot?


I don't want the extra cakePHP or any unused files laying in my directory.
No one said or wrote you'd have to.


After blindly figuring out that the lib/IDS might need go in the webserver root
Nope - that's neither true nor recommended. Check this line (https://trac.phpids.org/browser/trunk/docs/examples/example.php#L19).

Also you might want to customize the Config.ini correctly to fix the problem you are having. Check here (https://trac.phpids.org/browser/trunk/lib/IDS/Config/Config.ini#L19).

If you feel like the documentation isn't comprehensive feel free to help us making it better - feedback and concrete hints are always appreciated. We tend to concentrate on optimizing the system - not the cloud of words and docs around it until we reached version 0.5 or higher and experience showed that our users are cool with this. You can contact us at any time via mail, Gtalk, IM or whatever medium you prefer - don't hesitate to ask.

Greetings,
.mario

bgaylor
14.02.2008, 15:45
Ok, I was wrong to say that but its aggravating to spend the time trying to implement something that is being talked about and find no first clues to figure out what needs to happen and different options of implementation. I understand now that its in the early stage of development and most of the work should be focused on program improvement rather than documentation.

My further questions:
I have the IDS folder located not in the webserver root( misunderstanding on previous post) it is within my web server (xampp) root directory. It is two parent directories away from my programs.

I am going through the config.ini . It looks like I have it right but it is asking for a:
; file cache
path = /full/path/to/IDS/tmp/default_filter.cache
and I see no such file. Does it create this file upon use?

I couldn't find a sql query to create the database cache method which is optional I am assuming if not wanting to use file caching. So I commented it out.

The point of entry instructions are kinda vague. I don't know what to do in my *.php files to implement this.

I am trying to run the tests but code says it requires phpunit/framework/........

.mario
14.02.2008, 16:14
Hi!


It is two parent directories away from my programs.
Perfect.


and I see no such file. Does it create this file upon use?
Yep.


I couldn't find a sql query to create the database cache method
Yep - I have to confess it's a little bit hard to find - check here (https://trac.phpids.org/browser/trunk/lib/IDS/Caching/Database.php#L31). But anyway - regarding performance file caching makes no noticeable difference from database caching.


I am trying to run the tests but code says it requires phpunit/framework/
The tests make use of the almighty phpUnit framework by Sebastian Bergmann. You can istall it via PEAR or manually. You can find instructions here (http://www.phpunit.de/pocket_guide/3.2/en/installation.html).

I hope that helped.

Greetings,
.mario

bgaylor
14.02.2008, 17:14
Do you have to have PHPUnit?

.mario
15.02.2008, 09:53
Nope - just if you want to run the tests.