Board index   FAQ   Search  
Register  Login
Board index PHP PHP Installation

"phpinfo();" is working on command line but not on browser

Forum for you who has PHP installation issues

Moderators: macek, egami, gesf

"phpinfo();" is working on command line but not on browser

Postby Antrikssh » Wed May 02, 2012 6:02 am

Hello Everyone,

I am newbabie for PHP. I have installed php in my fedora 15 system by using tarball, it was installed successfully. When I created a sample page for testing, it executed on the command prompt but not on the browser. I will tell you what I have done.

1) Download the tarball php-5.3.9.tar.bz2 from the recognized site of php.
2) Then I have extracted it in home dir. by creating folder /php/php-5.3.9
3) After that [root]# cd /php/php-5.3.9 then it look like that [php-5.3.9]#
4) I have excuted the command along with different options
[php-5.3.9]# ./configure enable-maintainer-zts disable-cgi enable-cli \
disable-pear disable-xml disable-sqlite \
without-mysql enable-embed

I have executed all the option one by one
5) Then I have executed the command
[php-5.3.9]# make all install
this command install php in my system.
6) Then I executed command service httpd restart to restart the server.

After php installation , I created the php page by using phpinfo(); like that <? phpinfo(); ?> and save it index.php and put this file into /var/www/html/ location but when I was access it by typing
http://localhost/index.php it retured blank page but when I executed phpinfo(); from command prompt it work fine.
I have again executed command service httpd restart to restart the server but doesn't effect.

I am sure I have done a blundder mistake because lack of knowlege. Is anyone is there to help me to out of this??? Please help me.

Thanks and Regards,
Antrikssh
:)
Antrikssh
New php-forum User
New php-forum User
 
Posts: 22
Joined: Wed May 02, 2012 5:27 am

Re: "phpinfo();" is working on command line but not on brows

Postby Nullsig » Wed May 02, 2012 6:32 am

I suggest un-installing everything you have done so far and starting from scratch.

Use a LAMP server: https://www.linux.com/learn/tutorials/288158-easy-lamp-server-installation

Then try your phpinfo again and see what happens.

More than likely something was messed up in the process of setting up your system.
User avatar
Nullsig
php-forum Fan User
php-forum Fan User
 
Posts: 981
Joined: Thu Feb 17, 2011 6:52 am
Location: Racine, WI

Re: "phpinfo();" is working on command line but not on brows

Postby Antrikssh » Wed May 02, 2012 8:31 pm

Hello,

Thank you for time that you gave to solve my problem. I have installed php before that entire procedure that I have wrote in my thread, At that time my phpinfo(); is working fine. But I want complete hold on php setting for each task.For that, I have installed it by using tarball so that I know exact location of each file in my system beacause its very hard to configure the php that installed by using yum intall php command in fedora 15.

Ok then I will install it by using yum install php command but please help me for my further problems.

One thing more in article that you suggested me is also for apache and mysql. But I dont want to reinstall apache and mysql beacause I have lot of important data in mysql and also use httpd(Apache) for other purpose and both are working fine. So may I skip those instruction.

Thanks and Regards,
Antrikssh...... :)
Antrikssh
New php-forum User
New php-forum User
 
Posts: 22
Joined: Wed May 02, 2012 5:27 am

Re: "phpinfo();" is working on command line but not on brows

Postby Nullsig » Thu May 03, 2012 7:13 am

If it is already installed AND working then there should be no problem skipping those instructions
User avatar
Nullsig
php-forum Fan User
php-forum Fan User
 
Posts: 981
Joined: Thu Feb 17, 2011 6:52 am
Location: Racine, WI

Re: "phpinfo();" is working on command line but not on brows

Postby Antrikssh » Thu May 03, 2012 10:49 pm

Hi,

I have installed it, Now phpinfo(); is working as worked before. Now I want to use userdefine c/c++ function in php for that I user the link of Extension and Embeding in php which are (http://devzone.zend.com/303/extension-w ... /#Heading5) or(http://devzone.zend.com/1435/wrapping-c ... extension/) both link is usefull for me. I have made the my .c and .h file according to the documents and also follow each and every instruction of that document. After that, I got my .so file but when I was configure php.ini file according to the instruction it not gave me such output instead of that it gave me a fatal error.

I have made my .php file like that
<?php
dl('sample.so');
var_dump(get_loaded_modules());
?>

save it with name SampleTest.php in location /var/www/html/ in my system.Where sample.so is my .so file that I got after the entire procedure. I have also configured it in php.ini file like

extension_dir ="/extension/dir/path"
extension=sample.so


and put the sample.so file in the extension directory. After that restart my server(httpd) and executed the command http://localhost/SampleTest.php on the browser. I got blank page.

But when I executed on command prompt with php -q /var/www/html/SampleTest.php it return fatal error.

Fatal error: Call to undefined function get_loaded_modules() in /var/www/html/SampleTest.php on line 3

so what should I do. I have also executed the command php -m to see that sample.so file is configured in modules or not ,but it was not.

Please help me to out of this....

Thanks and Regards,

Antrikssh........ :)
Antrikssh
New php-forum User
New php-forum User
 
Posts: 22
Joined: Wed May 02, 2012 5:27 am


Return to PHP Installation

Who is online

Users browsing this forum: No registered users and 1 guest

Sponsored by Sitebuilder Web hosting and Traduzioni Italiano Rumeno and antispam for cPanel.

cron