F.A.Q.'s
PHP Questions
Q: Where
can I learn more about PHP?
A: For more
complete information you should consult the mSQL Web site at the PHP web site
at http://php.net/
Q:
Can I use PHP with SSL?
A: At this time, PHP
does not operate under SSL on our servers.
Q:
How can
I use and install the CGI version of PHP?
A: To
install PHP as a CGI script, telnet to your VServer and do the following:
% cd ~
% tar xvf /usr/local/contrib/php-2.0b12-msql-1.0.16.tar
This will install the php.cgi into the ~/www/cgi-bin directory for you to use.
If you would like more information on PHP, please visit the PHP web site at http://php.net/
NOTE: If you have FrontPage 98 extensions installed on your Virtual Server and
you use PHP, you must use PHP as a CGI script or your PHP will fail to
function.
Q: Why
is it necessary to use the CGI version of PHP with FrontPage 98 extensions?
A: If you have FrontPage 98 extensions
installed on your Virtual Server and you use PHP, you must use PHP as a CGI
script or your PHP will fail to function.
The reason is that during the installation of the FrontPage 98 extensions, your
web server was upgraded to Apache 1.2.4 which does not work with the compiled
PHP module.
If you would like more information on PHP, please visit the PHP web site at http://php.net/
Q: Do
you have a list of PHP functions I can use to access my MySQL database?
A: We can certainly understand the
frustration of trying to gather all the information necessary to access your
MySQL databases with PHP. Here is a list of the functions you can use, with
brief descriptions of each one. More information can be found by clicking the
link associated with each function. This information is pulled directly from
the PHP Website.
mysql_affected_rows
– Get number of affected rows in previous MySQL operation
mysql_change_user
– Change logged in user on active connection
mysql_close
– close MySQL connection
mysql_connect
– Open a connection to a MySQL Server
mysql_create_db
– Create a MySQL database
mysql_data_seek
– Move internal result pointer
mysql_db_query
– Send an MySQL query to MySQL
mysql_drop_db
– Drop (delete) a MySQL database
mysql_errno
– Returns the number of the error message from previous MySQL operation
mysql_error
– Returns the text of the error message from previous MySQL operation
mysql_fetch_array
– Fetch a result row as an associative array
mysql_fetch_field
– Get column information from a result and return as an object
mysql_fetch_lengths
– Get the length of each output in a result
mysql_fetch_object
– Fetch a result row as an object
mysql_fetch_row
– Get a result row as an enumerated array
mysql_field_name
– Get the name of the specified field in a result
mysql_field_seek
– Set result pointer to a specified field offset
mysql_field_table
– Get name of table the specified field is in
mysql_field_type
– Get the type of the specified field in a result
mysql_field_flags
– Get the flags associated with the specified field in a result
mysql_field_len
– Returns the length of the specified field
mysql_free_result
– Free result memory
mysql_insert_id
– Get the id generated from the previous INSERT operation
mysql_list_fields
– List MySQL result fields
mysql_list_dbs
– List databases available on on MySQL server
mysql_list_tables
– List tables in a MySQL database
mysql_num_fields
– Get number of fields in result
mysql_num_rows
– Get number of rows in result
mysql_pconnect
– Open a persistent connection to a MySQL Server
mysql_query
– Send an SQL query to MySQL
mysql_result
– Get result data
mysql_select_db
– Select a MySQL database
mysql_tablename
– Get table name of field
Q: How
can I customize my version of PHP3 without access to a PHP.INI file?
A: We compile PHP directly into our
Apache binary when we setup the Virtual Servers. As such you are able to
specify any of the PHP statements normally placed in the php3.ini (PHP3) or
php.ini (PHP4) file by using PHP directives in the Apache configuration files
(~/www/conf directory) as long as the statement has been compiled into our PHP
module.
Information on how to set this up is shown in greater detail on the PHP site at
this URL:
http://www.php.net/manual/configuration.php3
Please note that with the newer version of PHP4 there are fewer statements you
can utilize to make changes to the settings placed in the PHP module within the
Apache binary.
If you wish to use older versions of PHP on your server you can do so by simply
using the statements mentioned in "How
can I use multiple versions of PHP?"
For a current list of modules installed within Apache, Telnet or SSH to your
Virtual Server and enter the following command:
httpd –l
If you wish to see a list of the items installed within a specific
module (for instance mod_php.c) you would type:
httpd -h | grep mod_php3.c
You should receive output similar to the following:
php3_error_reporting (mod_php3.c)
php3_doc_root (mod_php3.c)
php3_user_dir (mod_php3.c)
php3_safe_mode_exec_dir (mod_php3.c)
php3_include_path (mod_php3.c)
php3_auto_prepend_file (mod_php3.c)
php3_auto_append_file (mod_php3.c)
php3_upload_tmp_dir (mod_php3.c)
php3_extension_dir (mod_php3.c)
php3_error_log (mod_php3.c)
php3_arg_separator (mod_php3.c)
php3_max_execution_time (mod_php3.c)
php3_memory_limit (mod_php3.c)
php3_sendmail_path (mod_php3.c)
php3_browscap (mod_php3.c)
php3_gpc_order (mod_php3.c)
php3_error_prepend_string (mod_php3.c)
php3_error_append_string (mod_php3.c)
php3_open_basedir (mod_php3.c)
php3_track_errors (mod_php3.c)
php3_magic_quotes_gpc (mod_php3.c)
php3_magic_quotes_runtime (mod_php3.c)
php3_short_open_tag (mod_php3.c)
php3_safe_mode (mod_php3.c)
php3_track_vars (mod_php3.c)
php3_sql_safe_mode (mod_php3.c)
php3_engine (mod_php3.c)
php3_xbithack (mod_php3.c)
php3_last_modified (mod_php3.c)
php3_log_errors (mod_php3.c)
php3_display_errors (mod_php3.c)
php3_magic_quotes_sybase (mod_php3.c)
php3_enable_dl (mod_php3.c)
As these are all customizations to your Virtual Server, we can only
offer support in how to setup your server to parse your PHP pages. RSH Web
Services Technical Support staff cannot support the customization of your PHP
configurations, or specific modules on your Virtual Server. For more
information on PHP modules and configurations, please visit:
http://www.php.net
Q:
How can I use
multiple versions of PHP?
A: You will need to place the
following lines in the SRM.CONF file for each version of PHP:
#PHP4
AddType application/x-httpd-php .php4
####
#PHP3
AddType application/x-httpd-php3 .php3
Action application/x-httpd-php3 /cgi-bin/imap-php
####
#PHP2
AddType application/x-httpd-php2 .php2
Action application/x-httpd-php2 /cgi-bin/php.cgi
If you still cannot use PHP2 or PHP3, please Contact our Support Team. Please
indicate whether you tried the above method.
Q: I
can't get PHP 2 to work on my Virtual Server.
A: We've discovered that under our new
BSDI 4 OS, php2 does not function correctly without some changes to the web
configurations. The reason for this is due to the following lines in the
srm.conf:
AddType application/x-httpd-php2 .phtml
Action application/x-httpd-php /cgi-bin/php.cgi
Under the old system, Apache was compiled with PHP3. Our BSDI 4 systems have
php4.0b2. As such, it is designed to respond to the application type x-httpd-php.
Thus, under the above configuration, even though you inform the Apache server
to parse all .phtml pages using /cgi-bin/php.cgi, the mod_php4.0b2 thinks that
the script should be parsed by the PHP4 interpreter, and the php2 code is
interpreted as bad code.
The solution? Change the configuration in the srm.conf (or .htaccess, if
applicable) to the following:
AddType application/x-httpd-php2 .phtml
Action application/x-httpd-php2 /cgi-bin/php.cgi
© RSH Web Services All Rights Reserved |