nadersolutions.com
home   |   about us   |   contact us   


  office: 407-448-3565   
fax: 407-650-3038   
   
information
 
 
 
 
 
 
Frequently Asked Questions
PHP Issues (UNIX)

PHP info
We provide both php3 and php4 to virtual clients. Any file with the extension with .htm will use php3. If the file extension is .cgi, then you can use php3 or 4. With the .cgi files, the first line of your code must contain the path to php. Here are examples for php3 and php4 respectively:

#!/usr/bin/php
#!/usr/bin/php4
One of these must be the first line of the script. On top of that, you must make sure that the file permissions are also set correctly.

You can see some information on our php3 and 4 configurations using the following code

Place this link into a php file: <?php phpinfo(); ?> This will give you up-to-date information for php on your server.

Connecting to MySQL through PHP
Use the following outline to connect and begin querying the mySQL server from within your PHP scripts. Remember that you cannot connect to your databases remotely due to security reasons. You can only connect to them form local host.

1. Connect To The mySQL Server
Use the following statement to connect to the database server. Substitute the username, and password for ones who have created in the MyAdmin interface and have given adequate permissions to this database.

MYSQL_CONNECT('localhost','USERNAME',' PASSWORD');

2. Select Your Database

Use the following statement to select the database you wish to connect to. Make sure you substitute the example with your database name.
@mysql_select_db("DATABASE NAME");

3. Executing A Query
You are now ready to execute your queries. Remember that the databases and users used must be created in the MyAdmin interface in your PCP. Most problems that arise with your scripts will be due to incorrect permission settings.

What is the path to PHP
We are currently running PHP 3.0.9 Below are all of the paths to PHP binaries.

/usr/bin/php
/usr/local/php
/usr/local/bin/php

How is PHP runo
Nader Solution offers PHP as an apache module and as a cgi binary. Our clients may take advantage of both of these methods.

What is the current version of PHP offered
PHP is offer in versions 3.0.9. and 4.0

Do I need to have a header on the top of my PHP scripts?
If you use php as a cgi, then you need the line #!/usr/bin/php in the first line of the script. If you are running this as an apache module, then you do not need this line.

Can I use PHP in Conjunction with MySQL?
Absolutely. Once of the big advantages of PHP is the ability to interface to databases, including mySQL. Since we offer mySQL as apart of our service, you can have PHP act as a front-end to your mySQL databases.
Not only is this possible, but it is very powerful. Many of the applications, such as parts of webhosting-support.com, are provided as PHP output querying from a mySQL database.

Where can I find more information on PHP and using it on my website?
PHP is quickly becoming a very popular scripting language. More information on PHP can be found on the official website, located at www.htm.net. On their website, you can find a listing on all PHP functions, libraries, example scripts, a mailing list for developers, and other useful information.

Does Nader Solution have the PDFlib installed for PHP?
Nader Solution currently has PDFlib 2.0 installed for PHP. This is the library needed to create PDF files on-the-fly using PHP.

Can I use short tags in my PHP scripts?
Yes, we have installed PHP to support short tags, so you can use this feature in your PHP scripts.

What resource limits has Nader Solution implemented in PHP?
Below are the resource limits we have implemented in all PHP scripts: Maximum execution time (run time on the CPU): 30 seconds Memory limit per process: 8MB of RAM This resource limits contain any runaway PHP scripts and terminate any PHP script which meets the criteria above.

Can I run PHP scripts anywhere on my virtual server?
Yes, PHP scripts do not have to reside in a particular directory and will run anywhere on your virtual server.

What is the maximum upload size I can have on PHP scripts?
The maximum size you can have for files which are uploaded through PHP is 10 Megabytes.

What is PHP?
PHP is a server-side, cross-platform, HTML embedded scripting language. It has a syntax familiar to both Perl and C. PHP-enabled web pages are treated just like regular HTML pages and you can create and edit them the same way you normally create regular HTML pages.

What are valid file extensions I can use for PHP scripts?
The valid file extensions for PHP scripts are listed below: .htm3 .htm These file extensions must be used in order for your PHP scripts to run properly.

What permissions do I need to use on my PHP scripts?
To avoid any problems, you should set your PHP scripts to 755, or user everything, group and world read and execute permission.

What userid does my PHP scripts run under?
Your PHP scripts will run under the same userid as the web server (Apache), which is "nobody". Therefore, since your PHP scripts do not run under your userid, you must take this into consideration when you are trying to create, edit, or modify files with your PHP scripts. Secondly, PHP scripts run under the group "nobody" as well. All clients are in the group "cust". Therefore, in order to allow PHP to create, modify, and/or delete files within your account, you would need to have world read/write permission on the files and within the directories where the files will be created.

Why won't my PHP scripts create/edit/delete files?
This is because your PHP scripts run under the userid "nobody" and group "nobody". In order to get around this, you will need to set the relevant files and directories to world read/writeable.