Installing Laravel 5 on shared cpanel hosting - php

I followed This tutorial for installing Laravel 5 on a shared cpanel hosting. Everything went smooth, but I get an error when I open my website:
Internal Server Error
The server encountered an internal error or misconfiguration and was
unable to complete your request.
Please contact the server administrator at webmaster#naxon.co.il to
inform them of the time this error occurred, and the actions you
performed just before this error.
More information about this error may be available in the server error
log.
Additionally, a 500 Internal Server Error error was encountered while
trying to use an ErrorDocument to handle the request. Apache/2.4.18
(Unix) OpenSSL/1.0.1e-fips mod_bwlimited/1.4 Server at naxon.co.il
Port 80
This is how my log file looks like:
[Sat Apr 09 00:36:06 2016] [error] [client *] SoftException in Application.cpp:256: File "/home/naxond/laravel/public/index.php" is writeable by group
[Sat Apr 09 00:36:06 2016] [error] [client *] Premature end of script headers: index.php
Any ideas?

Change the file permissions from '0664' to '0644'. It's complaining because that file (or folder) is writable by group and needs corrected to more secure permissions.

Before upload your project, you must to be sure that the server match the following requirements:
PHP >= 5.5.9
OpenSSL PHP Extension
PDO PHP Extension
Mbstring PHP Extension
Tokenizer PHP Extension
As you can see in your logs, all the erros are related with the server requirements:
Unable to load dynamic library '/usr/local/lib/php/extensions/no-debug-non-zts-20131226/php_mbstring.dll' you don't have Mbstring PHP Extension installed.
Unable to load dynamic library '/usr/local/lib/php/extensions/no-debug-non-zts-20131226/php_openssl.dll, you don't have OpenSSL PHP Extension
and so on.
You can check all the laravel requirements in their documentation.
Laravel 5 DOC
Anyway, you can try to install the libraries if you have full access to the server.
Regards!

Change public/index.php file permissions from 0664 to 0644

Related

"Failed to start the session: already started by PHP" error using a CMS

I installed a CMS, named Prestashop: it runs under a specific domain, and with a specific VirtualHost configuration on Apache, on a server with other PHP applications.
When I try to login in, as administrator user, I receive the following error (this is the Apache error log):
[Wed Jan 18 00:09:16.059190 2017] [:error] [pid 31253] [client xx.xx.xx.xx:63129] PHP Fatal error: Uncaught exception 'RuntimeException' with message 'Failed to start the session: already started by PHP.' in /opt/wp/apps/prestashop/app/cache/prod/classes.php:108\nStack trace:\n#0 /opt/wp/apps/prestashop/app/cache/prod/classes.php(483): Symfony\Component\HttpFoundation\Session\Storage\NativeSessionStorage->start()\n#1 /opt/wp/apps/prestashop/vendor/symfony/symfony/src/Symfony/Component/Security/Csrf/TokenStorage/SessionTokenStorage.php(90): Symfony\Component\HttpFoundation\Session\Session->start()\n#2 /opt/wp/apps/prestashop/vendor/symfony/symfony/src/Symfony/Component/Security/Csrf/CsrfTokenManager.php(54): Symfony\Component\Security\Csrf\TokenStorage\SessionTokenStorage->hasToken('ANONYMOUS_USER')\n#3 /opt/wp/apps/prestashop/app/cache/prod/classes.php(8196): Symfony\Component\Security\Csrf\CsrfTokenManager->getToken('ANONYMOUS_USER')\n#4 /opt/wp/apps/prestashop/classes/Link.php(722): PrestaShopBundle\Service\Routing\Router->generate('admin_product_c...')\n#5 /opt/wordpre in /opt/wp/apps/prestashop/app/bootstrap.php.cache on line 3216, referer: http://www.xxxxx.xx/adminXXX/index.php?controller=AdminLogin&token=181fa270d47386a8d523bdea6213932c&redirect=AdminDashboard'
PHP session auto_start parameter is set to 0 in php.ini.
I don't understand how can I solve this problem. It can be depends on an Apache or PHP configuration?
Thanks a lot.
I Just got the same issue with my Symfony 3.2 app, i was upgrading my web server from php 5.5.12 to php 5.6.31 when it happened. After upgrading again to php 7.0.23 everything go back to normal.

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

Bluemix PHP app fails on LDAP connection

This is a follow up ticket to one which was closed without answer:
https://stackoverflow.com/questions/34515574/ibm-bluemix-authentication-using-tivoli-ldap
I have migrated a PHP app which requires LDAP authentication to Bluemix and I am getting the following error:
2016-01-08T10:28:53.87+0000 [App/0] OUT 10:28:53 httpd | [Fri Jan 08 10:28:53.869250 2016] [proxy_fcgi:error] [pid 44:tid 139703240013568] [client 169.53.20.45:7120] AH01071: Got error 'PHP message: PHP Fatal error: Call to undefined function ldap_connect() in /home/vcap/app/htdocs/utils/LoginLDAP.Class.php on line 21\n', referer: http://sbrooms.w3ibm.mybluemix.net/index.php
Please note that this is not the public Bluemix, but the internal IBM one (w3ibm.mybluemix.net), hence the connection to the LDAP server should be available.
Do I have to explicitly request the connection to the LDAP server, or something else is going wrong?
Thanks,
Pimmy
Looks like the LDAP-Extension for PHP is not installed on the WebServer. The PHP message: PHP Fatal error: Call to undefined function ldap_connect() suggests that.
You can check that by adding a page to your webserver with the following content:
<?php
phpinfo();
Call that website in a webbroser and check whether there is any trace of the LDAP-extension. If not, you will need to get that extension. As there are many different ways to install it (from recompiling PHP to a call to your systems package-manager) I need more information on how your system - and especially PHP - has been installed.
Hope that helps!

Configure Laravel project on a DSO handler server

I have a Laravel 5.0 project that I want to test on servers that supports different php handler like:-
1. suPHP (Single user PHP)
2. FCGI (FastCGI)
3. CGI (Common Gateway Interface)
4. DSO (Dynamic Shared Object)
In case of first three the project works fine.
And also I tried to move the project out of public.
But when ever I try to run the project on a DSO server it fails.
There is just:-
1. Mozila -> blank screen
2. Chrome -> 500 error
The server I have is a VPS Linux server.
And I was just changing the php handlers.
For the first three case the php handler API is CGI
and For the DSO its Apache
Please let me know what would be the appropriate solution.
This is my error log
[Fri Nov 06 11:46:20.789176 2015] [:error] [pid 1111] [client 111.111.111.111:11111] PHP Fatal error: Uncaught exception 'UnexpectedValueException' with message 'The stream or file "/home/site-name/public_html/project-name/code/storage/logs/laravel-2015-11-06.log" could not be opened: failed to open stream: Permission denied' in /home/site-name/public_html/project-name/code/vendor/monolog/monolog/src/Monolog/Handler/StreamHandler.php:87\nStack trace:\n#0 /home/site-name/public_html/project-name/code/vendor/monolog/monolog/src/Monolog/Handler/RotatingFileHandler.php(88): Monolog\\Handler\\StreamHandler->write(Array)\n#1 /home/site-name/public_html/project-name/code/vendor/monolog/monolog/src/Monolog/Handler/AbstractProcessingHandler.php(37): Monolog\\Handler\\RotatingFileHandler->write(Array)\n#2 /home/site-name/public_html/project-name/code/vendor/monolog/monolog/src/Monolog/Logger.php(289): Monolog\\Handler\\AbstractProcessingHandler->handle(Array)\n#3 /home/site-name/public_html/project-name/code/vendor/monolog/monolog/src/Monolog/Logger.php in /home/site-name/public_html/project-name/code/vendor/monolog/monolog/src/Monolog/Handler/StreamHandler.php on line 87
Thank You
its just today I found the solution.
On a DSO server the file or folder permission should be set to 777 on the server.
And the exact path that gets affected due to this is Laravel-project/storage folder should have the 777 file permission. And also all the folders and files within it and more within.

pdflib9.0.2 is not installing in my MAMP for php5.5.10

I am trying to install pdflib9.0.2 extension for my MAMP php5.5.10. I did the following steps.
Downloaded pdflib9.0.2 from http://www.pdflib.com/download/pdflib-family/pdflib-9/copied
created a folder "pdflib" in htdocs
found the extension_dir path from php.ini /Applications/MAMP/bin/php/php5.5.10/lib/php/extensions/no-debug-non-zts-20121212
copied /Applications/MAMP/htdocs/pdflib/bind/php/php-550/php_pdflib.so to /Applications/MAMP/bin/php/php5.5.10/lib/php/extensions/no-debug-non-zts-20121212
changed the permission to rw mode.
added extension=php_pdflib.so under "Dynamic Extensions" in php.ini
commented the following in /Applications/MAMP/Library/bin/envvars
#if test "x$DYLD_LIBRARY_PATH" != "x" ; then
# DYLD_LIBRARY_PATH="/Applications/MAMP/Library/lib:$DYLD_LIBRARY_PATH"
#else
# DYLD_LIBRARY_PATH="/Applications/MAMP/Library/lib"
#fi
#export DYLD_LIBRARY_PATH****
But I could not see pdflib in my phpinfo()
I tried to access /pdflib/hello.php and I see following message in my apache error log
client denied by server configuration: /Applications/MAMP/htdocs/pdflib/.DS_Store
client denied by server configuration: /Applications/MAMP/htdocs/pdflib/bind/.DS_Store, referer: http:///pdflib/
I dont know where is going wrong.
I saw this version map in the doc. So I dont think there is a version mismatch.
bind/php/php-530 for PHP 5.3.0 and above
bind/php/php-540 for PHP 5.4.0 and above
bind/php/php-550 for PHP 5.5.0 and above
Can anyone one find out the issue here. Any input will show me a new path to solve this issue.
Thanks in advance.
I have added my Apache2 error log and php_error_log and I guess either one or both of these may be the reason for my unsuccessful installation of pdflib. If I can get some information to move forward to fix the issue, it will be very useful. Apache Error log [Tue Apr 15 11:38:22 2014] [error] [client ::1] client denied by server configuration: /Applications/MAMP/htdocs/pdflib/.DS_Store
[Tue Apr 15 11:38:24 2014] [error] [client ::1] client denied by server configuration: /Applications/MAMP/htdocs/pdflib/bind/.DS_Store, referer: http:///pdflib/ php_error_log [15-Apr-2014 11:25:08 America/Los_Angeles] PHP Warning: PHP Startup: PDFlib: Unable to initialize module
Module compiled with build ID=API20121212,TS
PHP compiled with build ID=API20121212,NTS
These options need to match
Your php_error_log tells:
php_error_log [15-Apr-2014 11:25:08 America/Los_Angeles] PHP Warning: PHP Startup: PDFlib: Unable to initialize module
Module compiled with build ID=API20121212,TS
PHP compiled with build ID=API20121212,NTS
These options need to match
This means that the PHP you are using is compiled "non thread safe", the PDFlib module you use is the "thread safe" variant. In a "non thread safe" php you can only use "non thread safe extensions. Sou you need to install the extension from the "php-550-nozts_VS11" directory of the PDFlib package.

Categories