Re: finding compile time errors



Michael Fesser wrote:
.oO(Jeff)

Thanks again for your kind assistance. I feel like I'm getting somewhere.

As I'm learning PHP, I'm making a fair number of mistakes in syntax.

In perl, you can turn on reading these errors from the browser by adding this:

use CGI::Carp 'fatalsToBrowser';

Is there something like this in PHP?

In PHP error messages are printed to the browser by default (or to the
console if you use the CLI version). With the error_reporting directive
you can control which types of errors should be shown. On a development
machine this directive should be set to E_ALL|E_STRICT in the php.ini.
Also make sure that display_errors is turned on.


OK, I'll find a check the PHP.ini file as I'm finding that the scripts silently fail.

Or do I need to find the php.ini file and look to see where the error log is?

By default there is no error log, but you can enable it.

I spent some time trying to figure out why my class constructor crashed until I found that I was writing php5 on a php4 setup. What is most of the established base, is it 4 or 5?

PHP 4 is dead, the last support for it will finally end in a few weeks.
After that there will be no more security fixes released. So there's
absolutely no point in writing PHP 4 scripts anymore. Use a recent 5.2
instead.

OK. The box I'm working on was initialized in this year. I expected 5 something. This must just be a preference with my web host (RackSpace).

I see in the php docs that some examples use 5.3, considering that the latest stable release is 5.2 I can see how there might be a lot of hair lost!

5.3 will introduce two major features that were "backported" from PHP 6,
but it's not released yet. It's not unusual that the manual already
contains short notes or even full documentation about coming features,
because many people already use 5.3 or even 6 for testing.

Thanks. I like the direction PHP seems to be going, but there are so many "functions"! I'm a bit overwhelmed!

Any recommendations on creating form elements? I've always used CGI.pm which handles all the gotchas. Is there anything that comes with the standard php install? All I really need is radio, select, checkbox and text... I'm used to writing what I need, but I'm also used to not reinventing a wheel that was written by someone far smarter!

There are various classes and libraries out there for creating and
maintaining forms with PHP. I can't recommend one, since I use my own
code. You could try a Google search.

I'm striking out, but am thinking to roll my own also.

Is there a standard include_path being used? Are there any standard extensions for included libararies, generally I'd like them to be seen *only* by the parent script.

Not sure what you mean.

If I name the included file 'my_functions.php' and put it in the web path, wouldn't some of this be visible from the web. I just want nothing to happen if someone hits http://my_domain.com/my_includes.php. Perhaps I'm worrying about nothing...


How does PHP handle placeholders in MySQL?

I'm used to doing this:

$sql='SELECT some_field FROM some_table WHERE another_field = ? AND other_field = ?';

When you do this (at least in perl), you don't have to worry about SQL insertion.

I can't seem to find this, and had stumbled across an example earlier. Perhaps I should break this question out in a new post...

Jeff

Micha
.



Relevant Pages

  • Re: What are the differences between Perl and PHP when handling with Web pages
    ... I will look for the modules mentioned below on cpan.org in order to understand how they work and how to write scripts using them. ... PHP is more limited than perl, but much simple to use for simple web pages ... PHP and Perl can run a program as a CGI script, but it is not recommended to ...
    (perl.beginners)
  • threadsort
    ... I recently translated a file-based perl cgi bulletin board ... script to php. ... Both scripts now produce the same output. ... first string in each array of string. ...
    (comp.lang.php)
  • Re: PHP versus Perl for server load?
    ... I tried both scripts, ... But I think they use a MySQL for saving downloading from amazon every time. ... but Perl is really not for HTML programming. ... I think Php is faster for complicated processes. ...
    (comp.lang.php)
  • Face lift survey
    ... A recent post that talked about a php calendar script got me thinking. ... that the php scripts they can get look really really nice, phpbb, for instance. ... does anyone think that with systems developed in Perl ... --But the world will not end if I make ugly html as long as it works like a tank! ...
    (perl.beginners)
  • Re: apache + .htpasswd - bypass pwd check
    ... | Please note that it is safe only if all scripts (PHP, perl, etc) are ... | running with user privileges. ... | If the suexec wrapped isn't active, or if PHP doesn't run in CGI mode, ... | files created by scripts will be owned by the server uid. ...
    (Vuln-Dev)