You are on page 1of 5

Training Document on

Troubleshooting PHP Common Issues

1. Information about PHP modules supported on our platform: 1. If the customer inquires about whether any of the PHP modules are supported on our platform or not, you just need to create a PHP file within the customers web-directory and provide the link. You need to add only the following three lines in the PHP file and name it as phpinfo.php <? phpinfo(); ?> 2. If they are requesting for specific PHP module, perform the first step and then search for the particular module listed in the output. i.e. http://<account URL>/phpinfo.php e.g. http://phptesting.ipage.com/phpinfo.php 3. Pear Modules: 1. PEAR is short for "PHP Extension and Application Repository". 2. The purpose of PEAR is to provide: A structured library of open-sourced code for PHP users A system for code distribution and package maintenance A standard style for code written in PHP The PHP Foundation Classes (PFC), The PHP Extension Community Library (PECL) 3. You can get the list of supported Pear modules in the Sidebar widget of Control Panel 4. If the module or any PHP functions are not listed, then you need to place a private ticket in the survey pool by checking the following help link: https://wiki.bizland.com/support/index.php/Policy:_Submitting_Custome r_Suggestions#Submitting_a_Suggestion_to_Add_or_Update_a_Feature _or_Service 2. You need to update the PHP session path in the php.ini file for the following common issues: 'Captcha' image not working in PHP driven websites Unable to install Joomla or any other PHP Applications Unable to log into any PHP driven websites If the customer inquires any issues related to the sessions.
Example: Warning: session_start() [function.session-start]: open(/var/phpsessions, O_RDWR) failed: No such file or directory (2)

You need to first verify in the web-directory if the cgi-bin/tmp folder exists and then update the php.ini with the correct session save path. You need to update the path at the following location: session.save_path (the field without a semicolon (;) in the beginning of the line as shown in the following image)

3. My PHP script does nothing or PHP driven website displays blank page: If customer tells that they don't get the output they were expecting, it is possible that the script has an invisible error somewhere. There are two ways to check if this is the case: Check your php.ini file and make sure "display_errors" is set to On. If your script has output content inside a HTML page, the errors may be obscured by the HTML - use the View Source functionality of your browser to search for "PHP". This should bring up any errors, if there are any. If you still do not see the error message, try these possibilities: Make sure you don't have output buffering hiding your output Make sure "error_reporting" is set to E_ALL in your php.ini file Make sure you have saved the latest version of your script Make sure all your includes are working If you are still having trouble, you need to seek out help from a developer. Best practice: Its always recommended to check if the Error Logs exists in the Control Panel under Script Library -> Check Error log. Alternatively, you could access the error logs directly using the following URL after logging into to the Control Panel: http://phptesting.ipage.com/stats/cgi_error_log i.e. http://username.property.com/stats/cgi_error_log

4. Information about the other php.ini settings to be updated safe_mode = Off If this is set to On, you probably compiled PHP with the --enable-safemode flag. Safe mode is most relevant to CGI use

register_globals = Off This setting allows you to decide whether you wish to register EGPCS
variables as global

magic_quotes_gpc = On This setting escapes quotes in incoming GET/POST/COOKIE data file_uploads = [on/off] Turn on this flag if you will upload files using PHP script If the file_uploads are on then you need to set the path in the following
field: upload_tmp_dir = /home/users/web/b1234/username/cgi-bin/tmp

Memory Limit memory_limit = 16M by default and you can increase this limit up to
124M

Whether to allow the treatment of URLs (like http:// or ftp://) as files. allow_url_fopen = Off or On Whether to allow include/require to open URLs (like http:// or ftp://) as
files. allow_url_include = Off or On

Zend Extension: PHP version 4


[Zend] zend_optimizer.optimization_level=15 zend_extension_manager.optimizer=/usr/local/Zend/Zend-2.5.7/lib/Optimizer-2.5.7 zend_extension_manager.optimizer_ts=/usr/local/Zend/Zend-2.5.7/lib/Optimizer_TS-2.5.7 zend_extension=/usr/local/Zend/Zend2.5.7/lib/ZendExtensionManager.so zend_extension_ts=/usr/local/Zend/Zend-2.5.7/lib/ZendExtensionManager_TS.so

PHP version 5.2 [Zend] zend_extension = /usr/local/lib/ioncube/ioncube_loader_lin_5.2.so zend_extension_manager.optimizer=/usr/local/Zend/lib/Optimizer-3.2.0 zend_extension_manager.optimizer_ts=/usr/local/Zend/lib/Optimizer_TS-3.2.0 zend_optimizer.version=3.2.0 zend_extension=/usr/local/Zend/lib/ZendExtensionManager.so zend_extension_ts=/usr/local/Zend/lib/ZendExtensionManager_TS.so PHP version 5.3
Zend Optimizer is not supported.

Advanced Information on troubleshooting some of the Common PHP Issues 5. Fatal error: Cannot re-declare (function)
example: Fatal error: Cannot redeclare wfprofilein() (previously declared in /herms/b1234/hoc.testtraining/w/includes/profiler/Profiler.php:14) in /herms/b1234/hoc.testtraining/w/includes/Profiler.php on line 19

If you find PHP telling it cannot redeclare a function created in the website, there are two possibilities: You're using a name which is already being used by PHP. For example, in_array() is a standard PHP function - you cannot make your own function called in_array(). Try searching the PHP manual for the function name, and if it matches, change yours to a different name.

If the function name is not in the PHP manual, then the problem is because you

have had the function defined twice. This often happens when you put a function into a file, then include() that file more than once.

6. Call to undefined function:


example: Fatal error: Call to undefined function: mysql_connect() in /herms/b1234/hoc.testtraining/system/databases/mysql.class.php on line 112 This error message is fairly self-explanatory, and basically means that you have called a function which PHP hasn't heard of. There are three possible reasons for this:

You typed in the wrong function, e.g. inarray() rather than in_array(). Check the line
number in the PHP error logs and make sure you have the right function in there.

You're using variable functions, e.g. $foo(), and the variable does not include the right
text.

Your function is in an external file that is not being included, potentially because the
include() call is inside an if statement that is not executed. Check if the function is included properly.

Parse error:
example: Parse error: parse error, unexpected $end in /herms/b1234/hoc.testtraining/system/heredoc.php on line 8 This is a very generic error message that simply means "PHP failed to understand your script", which in turn means that there is a syntax error in your script. Possible causes for this include:

Forgetting a semi-colon at the end of the line before the line number shown in the
error message.

Not escaping quotes in a string for eg. ('\n); instead of ('\n'); You used "case default:" rather than just "default:" in a switch/case statement

You might also like