Ubuntu 11.10 PHP don't proceed - php

i've just setup a LAMP development environment on my laptop, all works fine except for php. Apache don't process PHP code embeded inside pages, and display no error. All php package seems to be correctly installed.
Testing a simple: <?php phpinfo(); ?>, give a blank page
error log give:
[Fri Mar 02 20:30:13 2012] [error] [client 127.0.0.1] PHP Fatal error: Unknown: Failed opening required '/home/lib/utils/setDocumentRoot.php' (include_path='.:/usr/share/php:/usr/share/pear') in Unknown on line 0

I finally solve my problem, it was due to a fix i've set in my virtualHost config (who was calling a missing file: setDocumentRoot.php), i've disabled that script and all works great.

Related

Access Telegram-CLI using php

I want to access the Telegram-CLI using PHP.
I'm compiled Telegram-CLI and loged in to my account, and its works like a charm.
I installed LAMP ([in Linux], Apache, MySQL, PHP) and i tested them works.
I even installed these [following] PHP packages one-by-one using "Composer" and tested the examples but i couldnt make them run...
Also it seems their forum are abandoned to get my questions answer.
php-client for telegram-cli
A wrapper for Telegram-CLI
PHP Wrapper and Drupal module using Telegram CLI
Could somebody tell me how to make one of them work in simple way.
All steps of building Telegram-cli, loging in for first time and run it as deamon has beed completed.
For Example:
This project has been installed on php project root dir using "Composer".
Example.php file has been moved to web server root directory.
But also unning it cause a 500 Internal server error.
The error line is:
$telegram = new \Zyberspace\Telegram\Cli\Client('unix:///tmp/tg.sck');
notices:
The file has been checked and is already there.
And the telegram-cli is running as a daemon on root user.
I added a telegramd group and telegramd user assigned to that group.
I detacted that php commands running under apache user account.
I changed the apache user group to telegramd.
But again nothing...
So, Please help me
Edit:
I changed the httpd.conf user and group parameters to run at the same (telegramd) account
User telegramd
Group telegramd
And i have restarted the apache and checked the username by
exec('whoami');
The Apache is running under "telegramd" user account.
But nothing again..
Edit 2:
error_log file:
[Wed Feb 10 11:02:04.251133 2016] [:error] [pid 1172] [client 10.0.1.24:49168] PHP Warning: stream_socket_client(): unable to connect to unix:///tmp/tg.sck (No such file or directory) in /var/www/html/vendor/zyberspace/telegram-cli-client/lib/Zyberspace/Telegram/Cli/RawClient.php on line 48
[Wed Feb 10 11:02:04.251332 2016] [:error] [pid 1172] [client 10.0.1.24:49168] PHP Fatal error: Uncaught exception 'Zyberspace\Telegram\Cli\ClientException' with message 'Could not connect to socket "unix:///tmp/tg.sck"' in /var/www/html/vendor/zyberspace/telegram-cli-client/lib/Zyberspace/Telegram/Cli/RawClient.php:51\nStack trace:\n#0 /var/www/html/example.php(10): Zyberspace\Telegram\Cli\RawClient->__construct('unix:///tmp/tg....')\n#1 {main}\n thrown in /var/www/html/vendor/zyberspace/telegram-cli-client/lib/Zyberspace/Telegram/Cli/RawClient.php on line 51

PHP unable to open include file

I have a problem with a PHP script. The following error is being logged whenever the site is accessed:
[Fri Sep 26 11:57:56 2014] [error] [client 31.22.44.2]
PHP Fatal error: require_once(): Failed opening required
'./sites/default/modules/views/handlers/views_handler_field_markup.inc'
(include_path='.:/usr/share/php:/usr/share/pear') in
/var/www/www.xoomtalk.com/htdocs/sites/default/modules/views/includes/handlers.inc
on line 76
I have confirmed that the file referenced is present, and that www-data can access it. Permissions look fine and have not been changed as far as I am aware
What am I missing?
[Fri Sep 26 11:57:56 2014] [error] [client 31.22.44.2] PHP Fatal
error: require_once(): Failed opening required
'./sites/default/modules/views/handlers/views_handler_field_markup.inc'
(include_path='.:/usr/share/php:/usr/share/pear') in
/var/www/www.xoomtalk.com/htdocs/sites/default/modules/views/includes/handlers.inc
on line 76
Add path /var/www/www.xoomtalk.com/htdocs into your include_path
More explains:
your include_path=.:/usr/share/php:/usr/share/pear , means php script will find include file in: current_path, /usr/share/php or /usr/share/pear
when you want to require this file
./sites/default/modules/views/handlers/views_handler_field_markup.inc
all allowed path are:
(current path)
/var/www/www.xoomtalk.com/htdocs/sites/default/modules/views/includes/./sites/default/modules/views/handlers/views_handler_field_markup.inc
(/usr/share/php) /usr/share/php/./sites/default/modules/views/handlers/views_handler_field_markup.inc
(/usr/share/pear)
/usr/share/pear/sites/default/modules/views/handlers/views_handler_field_markup.inc
In these path ,php can't find the file.
in the following file:
/var/www/www.xoomtalk.com/htdocs/sites/default/modules/views/includes/handlers.inc
on line 76
Change This:
'./sites/default/modules/views/handlers/views_handler_field_markup.inc'
to THIS: '/var/www/www.xoomtalk.com/htdocs/sites/default/modules/views/handlers/views_handler_field_markup.inc'
This should do the trick.
The problem is, you're using scripts from various directories, but the "root" of the request is the cwd (current working directory) which you can check with: getcwd()
(and you're requesting the include relative to the cwd.
I managed to solve this problem, ended up being nothing to do with permissions or paths, although there was no indication of this in the Apache logs.
The problem was that the server was also running AppArmor which for some reason was blocking the Apache process from accessing the files.
AppArmor was set to complain rather than enforce mode for testing (command is aa-complain apache2) this made everything start working.
Thanks to all contributors for their suggestions.

How to get rid off the apache error?

I'm using PHP, Smarty, jQuery, etc. for my website. I'm getting following error from the apache error log.
[Mon Apr 14 12:27:02 2014] [error] [client 127.0.0.1] PHP Fatal error: Unknown: Failed opening required '/var/www/smart-rebate-web/web/admin/change_password.php' (include_path='.:/usr/share/php:/usr/share/pear') in Unknown on line 0, referer: http://localhost/smart-rebate-web/web/admin/
I've checked all the configuration settings and permissions. Everything is correct. Then why this error is coming from apache? Also there is no error printing in a bowser when I run a webpage, ablank webpage appears. I googled a lot about the solution but couldn't find out the exact solution. Checked all the configurration settings. So, can anyone help me in resolving this error please? If you need any further information I can provide you the same.
Go to your php.ini and set
display_errors = on
and restart your web server, you will get errors on browser ;)

phpmyadmin is white page

I installed on my win 7 apache 2.4, PHP 5.5.3, mysql 5.6 & last version of phpmymyadmin
I checked my server and it's working good as the phpinfo(); is working correctly.
When I installed phpmyadmin I got a blank white page without any errors, so I checked the apache error log and received below error
[Tue Sep 10 20:40:48.431821 2013] [:error] [pid 2344:tid 1048] [client ::1:59511] PHP Fatal error: Call to undefined function PMA_DBI_num_rows() in C:\\Apache24\\htdocs\\phpMyAdmin\\libraries\\navigation\\Nodes\\Node.class.php on line 397
Any idea what's wrong and how to solve?
You miss the mysql or mysqli PHP extension (or they are not active). See
https://sourceforge.net/p/phpmyadmin/bugs/3997/
Why don't you just use xampp or wampp ? http://apachefriends.org

PHP error for an include file on server

I've recently moved my site to a new server and I'm getting the following error on the new server.
[Thu Jan 17 01:30:09 2013] [error] [client] PHP Fatal error: require_once(): Failed opening required 'RB/stdlib.php' (include_path='.:/usr/share/php:/usr/share/pear') in /usr/share/application.php on line 90
I may not have copied a the RB directory but I'm unsure where it is. I've copied the pear folder but still receiving the same error.
Any idea how to resolve this issue and how to get the RB folder with the libs on the new server?
Thanks

Categories