Category Archives: php

PHP configure: error: Cannot find pspell

While compile php on a plain server, I received following error:

 

configure: error: Cannot find pspell

 

To fix this, install aspell-devel.

yum install aspell-devel


contact@webhostingsupport.info

Post to Twitter

PHP Parse error: syntax error, unexpected T_STRING

If you see error PHP Parse error: syntax error, unexpected T_STRING on accessing your site.

This error is commonly caused because you have not have short_open_tag set in php.ini. Enabling this will solve your problem.

1) If you have a Suexec/suphp enabled on server server , then you can create php.ini file under document root and add following

short_open_tag = X

2) If Suexec/suphp is disabled then you can crate .htaccess file under document root and add following.

short_open_tag X

That’s all


contact@webhostingsupport.info

Post to Twitter

PHP fatal error: session_start()

For some reason for a PHP script if you get such error:

Fatal error: session_start()

Or

Warning: session_start() [function.session-start]

Check session.save_path in your configuration file and check the path if you have correctly set.

Generally session file are saved to server /tmp directory.

If your server is not suexec and suphp then you can add this line in your .htaccess file:

php_value session.save_path tmp

If server has suexec and suphp enabled then you will need to create a php.ini file in your document root and add following.

session.save_path = /tmp

And try now, make sure that the session path in your program is /tmp if it is something other you can set it to your session path – this worked for me.


contact@webhostingsupport.info

Post to Twitter

Warning: include() [function.include]: URL file-access is disabled

I see the warning message while access my .php file.

Warning: include() [function.include]: URL file-access is disabled

On investigating I found allow_url_fopen and allow_url_include were disable.

To check the status you can create a phpinfo file to check you php configuration. Following is the code for phpinfo.

<? phpinfo(); ?>

Now access the file in browser and check for allow_url_fopen and allow_url_include if it is set to off then you will need to enable it.

You can enable it by creating .htaccess file or php.ini file locally.

Code for .htaccess file

php_flag allow_url_fopen On

php_flag allow_url_include On

======================

Code for php.ini file

allow_url_fopen = On

allow_url_include = On

That’s it.


contact@webhostingsupport.info

Post to Twitter

How to change date and time zone in php

If your php script is not showing correct date and time then it means your script is using date and time zone configured on your server.

If you want to set your own date and time zone for your domain then it can be done in a very simple manner.

You will need to create php.ini in document root of your domain.

[root@Server ~]#nano php.ini

and enter following line.

date.timezone =Asia/Jakarta

save and exit from file.

Now create phpininfo page and open it in browser and you will see that date and time zone have been enabled.


contact@webhostingsupport.info

Post to Twitter