phpDocumentor directory does not exist - phpdoc

Im trying to run phpDocumentor on a new server with the following command:
phpdoc -d /var/www/vhosts/mysite.com/httpdocs/source -t /var/www/vhosts/mysite.com/httpdocs/docs
But it always says:
[InvalidArgumentException]
The "/var/www/vhosts/mysite.com/httpdocs/source" directory does not exist.
I give 777 permissions to source and docs folder, but that doesn't work.

Related

Error when creating new project in laravel

What i have tried:
1) Install php7.2
2) Install Composer
3) run command composer global require "laravel/installer"
But when i run laravel new blog the output error is the following:
The provided cwd does not exist.
The provided cwd does not exist means that the Current Working Directory does not exist which means that laravel new command was unable to create the directory 'blog' because you do not have the permission to do so.
What you can do is to change the permissions for that directory, so the command is able to create the working directory

How to install Laravel as Apache user

First off: I'm very familiar with Composer and also Symfony and some other MVC frameworks.
I tried the following installation documentation, but I'm stuck on how to properly install a laravel project as "apache:apache" under "/var/www/html" on a CentOS 6 virtual machine.
I ran the composer global require "laravel/installer" command, and it says to put "~/.composer/vendor/bin" in your PATH. So I presume this command (laravel install) is done as a normal user (not root), and the folder will exist in your home directory when run.
I added to my path by editing my /etc/profile to include this. But when I try to run laravel new laraveltest in the /var/www/html folder (owned by apache), I get:
[abunk#Alvin-CentOS6 html]$ laravel new laraveltest
Crafting application...
PHP Warning: file_put_contents(/var/www/html/laravel_572e877d514bacbb7381860b8307a067.zip): failed to open stream: Permission denied in /tmp/.composer/vendor/laravel/installer/src/NewCommand.php on line 122
PHP Warning: ZipArchive::extractTo(): Permission denied in /tmp/.composer/vendor/laravel/installer/src/NewCommand.php on line 140
PHP Warning: ZipArchive::close(): Invalid or uninitialized Zip object in /tmp/.composer/vendor/laravel/installer/src/NewCommand.php on line 142
Composer could not find a composer.json file in /var/www/html
To initialize a project, please create a composer.json file as described in the https://getcomposer.org/ "Getting Started" section
Application ready! Build something amazing.
So then I copied the folder /home/abunk/.composer to /tmp/.composer; and then I ran su -s /bin/sh apache -c "laravel new laraveltest" from the /var/www/html folder (this should run as apache).
But instead I get this:
[abunk#Alvin-CentOS6 html]$ su -s /bin/sh apache -c "laravel new laraveltest"
Password:
Crafting application...
PHP Warning: proc_open(/dev/tty): failed to open stream: No such device or address in /tmp/.composer/vendor/symfony/process/Process.php on line 290
[Symfony\Component\Process\Exception\RuntimeException]
Unable to launch a new process.
new [--dev] [--] []
So my question is (or maybe this is really a bug): How do install as the apache user? Any recommendations?
I could do this as root user, but I think it's a bad idea to run Composer as root user.

laravel application moved to another pc

I have just transferred my laravel application to another pc and I have installed composer. I am running composer install at the root of the project but it shows the following error:
{"error":{"type":"ErrorException","message":"file_put_contents(\/meta\/services.
json): failed to open stream: No such file or directory","file":"C:\\national-fl
eet\\vendor\\laravel\\framework\\src\\Illuminate\\Filesystem\\Filesystem.php","l
ine":71}}
I tried CACLS -R 755 app/storage (as admin)
and then composer update but the same error. bootstrap/compiled.php doesn't exists in my project. What should I do?
I got this error, because some folders in /app/storage were missing
To fix the error, I manually created the following folders:
app/storage/
app/storage/cache/
app/storage/logs/
app/storage/meta/
app/storage/sessions/
app/storage/views/
then delete the contents of my vendor folder and run composer update again
Try to remove the services.json in /meta (or rename it to something else) and try composer install again (or composer update). It is possible that the file hasn't got the correct rights for Laravel to write to.

PHP Composer can't find composer.json file for my project

I have successfully installed Composer in the root directory (that was the default choice) on my Linux/Apache server using their installation guide. It's all been very simple so far, except for one php.ini tweak I've had to make (detect_unicode = Off) but now I'm stuck.
I'm trying to install Ratchet using Composer, with the use of this guide:
http://socketo.me/docs/install
It says I need to "create a file called composer.json in your project folder". So I created that file (with the contents they gave on their page) using the cPanel file manager, in my application's root directory. However, when I run Composer using:
php composer.phar install
PuTTy gives the following error message:
Composer could not find a composer.json file in /root
To initialize a project, please create a composer.json file as described in the http://getcomposer.org/ "Getting Started" section
But this doesn't seem to make sense, why would I place the JSON file in the server's root if the documentation says to place it in the project folder? What am I missing?
I just found on other topic that you can use :
php composer.phar --working-dir=/home/user/folder/ update
It looks like you're executing php composer.phar install in /root path.

How to properly duplicate a working Laravel 4 project

I have the latest Laravel 4 beta 5 build from Laravel's github repo.
I have built a simple web API and it is working fine. I wanted to duplicate the project to another folder and continue working on it from the copy. However, when I try that, I get the following error message:
InvalidArgumentException
Driver [native] not supported.
/Users/tolga/Sites/l4api-copy/bootstrap/compiled.php
Line 10908: throw new \InvalidArgumentException("Driver [{$driver}] not supported.");
Here is what I did in order to copy the project:
[/Users/tolga/Sites] $ cp -R l4api l4api-copy
[/Users/tolga/Sites] $ chmod -R 755 l4api-copy
It didn't work, so I've tried:
[/Users/tolga/Sites] $ chmod -R 777 l4api-copy/app/storage
Still no good, tried to run composer dump-autoload:
[/Users/tolga/Sites] $ cd l4api-copy
[/Users/tolga/Sites/l4api-copy] $ composer.phar dump-autoload
Generating autoload files
[/Users/tolga/Sites/l4api-copy] $
Same error. I have also tried to remove the app/storage folder and re-create it.
[/Users/tolga/Sites/l4api-copy] $ rm -Rf app/storage
[/Users/tolga/Sites/l4api-copy] $ mkdir app/storage
[/Users/tolga/Sites/l4api-copy] $ chmod -R 777 app/storage/
Here is a brand-new error:
ErrorException
Warning: file_put_contents(/Users/tolga/Sites/l4api-copy/bootstrap/../app/storage/meta/services.json):
failed to open stream: No such file or directory in
/Users/tolga/Sites/l4api-copy/bootstrap/compiled.php line 5507
Line 5507: return file_put_contents($path, $contents);
I have also run composer.phar dump-autoload command again, after emptying the app/storage folder.
And finally, I have also tried composer.phar install:
[/Users/tolga/Sites/l4api-copy] $ composer.phar install
Loading composer repositories with package information
Installing dependencies from lock file
Nothing to install or update
Generating autoload files
[/Users/tolga/Sites/l4api-copy] $
None of the above helped. What am I doing wrong? What is the proper way to duplicate a working project?
After a recent commit to the laravel/laravel repository a new session driver, native, has been introduced. From the looks of your errors you should update your application skeleton (the cloned develop branch of laravel/laravel), delete your bootstrap/compiled.php file and re-run composer update to pull in the latest framework changes.
In terms of copying the project you should copy over everything except the vendor directory then run composer install in the new location. You could copy the vendor directory but it's better to run a clean install and let composer dump a new autoload.
I've also seen Taylor mention a cleanup of your app/storage/sessions directory. Delete all the files in there.

Resources