How write in files through TYPO3 Command Controller - php

I wanna create files and write in log file through a TYPO3 command controller. I have used command controller, this is registered in ext_localconf as $GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['extbase']['commandControllers'][] = VENDOR\ExtName\Command\GeneradorArchivosEncuestasCommandController::class;; the objetctive of this command controller is to create all templates in xlsx of a surveys of my extension domain, but in the mopment to create a file or write inside log files, I have the next error: failed to open stream: Permission denied.
Otherwise, the directories has 775 permissions and owner apache as group; and the users: _cli_lowlevel and _cli_scheduler, those user have the same file mount in BE referenced to typo3temp.
I am using TYPO3 7.6, PHP 5.6, Apache 2.2.15

Related

The stream or file "D:\Inetpub.....\storage\logs/laravel.log" could not be opened in append mode: failed to open stream: Permission denied on Windows

I have a website made with Laravel, I need to upload it to windows server (Plesk Cpanel) i have set the database and everything is good, but when trying to open the website it shows me :
The stream or file "D:\Inetpub.....\storage\logs/laravel.log" could not be opened in append mode: failed to open stream: Permission denied
no solution found for windows any help, please?
You must change permissions for this file, or for all "storage" dir.
I found this in Google for Plesk - Link for Plesk and for Cpanel - Lunk for CPanel.
You must set 777 or read, write, execute permissions for all groups.
Or read here what permissions you need.
Good luck!
sudo chmod 777 path/to/project/storage/logs/laravel.log

Laravel 5.7, preset bootstrap error. Failed to open stream

I'm trying to use the laravel 5.7 bootstrap4 preset, but have problems using it.
Do you guys know why I see this error? Why is the file missing? I have not changed the path to anything.
kgp43:~/workspace (master) $ php artisan preset bootstrap
In Bootstrap.php line 41:
copy(/home/ubuntu/workspace/resources/sass/_variables.scss): failed to open stream: No such file or directory
I found the error.
All folders in the Assets directory has to be moved up one level.
It should not be needed to move the content of the Assets folder (accoring to laravel - but it was for me to run the preset command.
https://laravel.com/docs/5.7/upgrade

PHP rename() permission denied via Apache (SELinux related)

I have a simple script that outputs Permission denied warning in the browser:
rename('/opt/web/test.tmp', '/opt/web/test.tmp1')
Script path is /opt/web/test_rename.php
/opt/, /opt/web/ and /opt/web/test_rename.php are 777 and have apache owner / group.
httpd process owner is apache
test.tmp is 777 and have apache owner as well
It works fine with cli.
What else could I do to make it work via apache?
The problem was with SELinux. It can block php rename function.
I've found the answer here: http://forums.fedoraforum.org/archive/index.php/t-111081.html
On the Fedora Core 3 Linux distribution, you may get a "failed to open stream: Permission denied in ..." message. In fact changing the permission of the directory will not work (even if you set to 0777).
It is because of the new SELinux kernel that allow apache user to write only in /tmp dir (I think). In order to solve the problem you must to disable the SELinux (at least for apache service) to allow the server to write in other directories. To do that, run the system-config-securitylevel app and disable the SE to apache service. Reboot your system and continue your work.

Symfony 2.4 project deployment without SSH

I have made a small project with symfony 2.4 at my local system. I have uploaded all the project files to my shared hosting server with same directory structure and database. Only the name of my public directory is "public_html" instead of "web". I don't have SSH access to this server. When i run the website by typing the domain name then it shows blank page. I see below given error in my server's log file:
adminhelpline.com [Sun Apr 20 17:08:55 2014] [error] [client 5.10.83.33:35937] AH01215: PHP Warning: require_once(/home/sites/adminhelpline.com/vendor/composer/autoload_real.php): failed to open stream: No such file or directory in /home/sites/adminhelpline.com/vendor/autoload.php on line 5
My Autoload file looks like this:
<?php
// autoload.php #generated by Composer
require_once __DIR__ . '/composer' . '/autoload_real.php';
return ComposerAutoloaderInit48e5d1e7fa77bf3d631b331b6343761b::getLoader();
Can anyone help me to sort out the problem?
it's quite simply. what the error log tells you that the file autoload_real.php in the folder /home/sites/adminhelpline.com/vendor/composer doesn't exist.
check the structure of your folders I assume you use some sort of ftp client? the worst case try to change the autoload.php not to include that file and see what you get or just move the file to the same folder as the autoload.php and change line 5 folder structure.
Execute composer update in your local machine, and then deploy the generated vendor/ folder.
This folder will contain the dependencies and the generated autoload

Permission denied with nginx and php

I have create under my nginx webdir a ln -s (symbolic link) to a directory in my homedir
I now try to read it from a PHP script but get:
Warning: opendir(/usr/local/n/test): failed to open dir: Permission denied in /usr/local/n
I have set no open base dir in php.ini
directory and files are having a group in which the web user is part of
both nginx and php fpm run under that same user
How can I fix this?
The only solution to this was to copy the files. I wasn't able to get nginx to read symbolically linked files.
I've seen recommendations that the files under the main 'public' or 'html' directory can be followed, but this was not the case for me.
I remember there is option in php or nginx(apache) to allow symbolic link, you need to check that.
you could search google : nginx and php using symbolic link
I couldn't remember that option exactly.

Categories