Jump to content

mstdmstdd

Members
  • Posts

    146
  • Joined

  • Last visited

Everything posted by mstdmstdd

  1. Hello, Installing and running migration my laravel 5.8 app on new server under vultr vps I got error: https://imgur.com/a/87KgTQ4 php info is here : http://phpstack-231450-837582.cloudwaysapps.com/ How fix this error ? Thanks!
  2. Hello, I work with envoy installing, like https://dyrynda.com.au/blog/an-envoyer-like-deployment-script-using-envoy: and I run the script when ln command is run successfully # Import the environment config echo 'Linking .env file'; cd {{ $release_dir }}/{{ $release }}; ln -nfs {{ $base_dir }}/.env .env; # Symlink the latest release to the current directory echo 'Linking current release'; ln -nfs {{ $release_dir }}/{{ $release }} {{ $current_dir }}; As I see symbol link to newly release directory is created. But I am not sure how to use it? with apache installed on my ubuntu server I tried to create new config dir but running a2ensite hostels2.com.conf and restarting apache I got errors: Apr 30 12:29:46 nsn-do-lamp systemd[1]: Starting The Apache HTTP Server... Apr 30 12:29:46 nsn-do-lamp apachectl[6403]: AH00112: Warning: DocumentRoot [/var/www/html/Hostels2Deployed/current/public] does not exist Apr 30 12:29:46 nsn-do-lamp apachectl[6403]: (2)No such file or directory: AH02291: Cannot access directory '/var/www/html/Hostels2Deployed/current/storage/logs/' for error log of vhost defined at /etc/apache2/sites Apr 30 12:29:46 nsn-do-lamp apachectl[6403]: AH00014: Configuration check failed Apr 30 12:29:46 nsn-do-lamp apachectl[6403]: Action 'start' failed. Apr 30 12:29:46 nsn-do-lamp apachectl[6403]: The Apache error log may have more information. Apr 30 12:29:46 nsn-do-lamp systemd[1]: apache2.service: Control process exited, code=exited status=1 Apr 30 12:29:46 nsn-do-lamp systemd[1]: apache2.service: Failed with result 'exit-code'. Apr 30 12:29:46 nsn-do-lamp systemd[1]: Failed to start The Apache HTTP Server. In my /etc/apache2/sites-available/hostels2.com.conf : <VirtualHost *:80> ServerAdmin webmaster@localhost DocumentRoot /var/www/html/Hostels2Deployed/current/public ServerName myurl ServerAlias myurl <Directory /var/www/html/Hostels2Deployed/current/public> AllowOverride All Order Deny,Allow Allow from all Require all granted </Directory> Options FollowSymLinks DirectoryIndex index.php ErrorLog /var/www/html/Hostels2Deployed/current/storage/logs/error.log CustomLog /var/www/html/Hostels2Deployed/current/storage/logs/access.log combined </VirtualHost> The output of my envoy command has. 7.4]: Step # 5 : Symlink set [lardeployer@138.68.107.4]: Step # 50 : /var/www/html/Hostels2Deployed/release/20190430151627 [lardeployer@138.68.107.4]: Step # 5 : Symlink has been set current_dir : /var/www/html/Hostels2Deployed/current But on my server I see wrong link, but I do not see why: cd /var/www/html/Hostels2Deployed/current https://imgur.com/a/Sw22oWh ? Thanks!
  3. I read file content $filename = '0001.jpg'; $filename_content= file_get_contents($filename_path); $appMailchimp= new appMailchimp(); $newMailChimpFile=$appMailchimp->addFile($filename, $filename_content); and public function addFile( $file_name, $file_data ) { $is_debug = true; $url = $this->m_base_url .'file-manager/files' ; $fileInfo = [ 'name' => $file_name, 'folder_id'=> 5673, 'file_data'=> $file_data ]; echo '<pre>-2 addFile $url::'.print_r($url,true).'</pre>'; if($is_debug) echo '<pre> -1 addFile $fileInfo::' . print_r( $fileInfo, true ) . '</pre>'; $ch = curl_init( trim($url) ); curl_setopt( $ch, CURLOPT_USERPWD, 'user:' . $this->m_mailchimp_api_key ); curl_setopt( $ch, CURLOPT_HTTPHEADER, [ 'Content-Type: application/json' ] ); curl_setopt( $ch, CURLOPT_RETURNTRANSFER, true ); curl_setopt( $ch, CURLOPT_TIMEOUT, 10 ); curl_setopt( $ch, CURLOPT_CUSTOMREQUEST, "POST" ); curl_setopt( $ch, CURLOPT_SSL_VERIFYPEER, false ); curl_setopt( $ch, CURLOPT_POSTFIELDS, json_encode( $fileInfo ) ); $newFile = json_decode( curl_exec( $ch ) ); var_dump($newFile); and error : and output : http://imgur.com/a/ggRQO
  4. Yes, $fileInfo was defined before cURL call, in the same scope. I also tried to use file_get_contents for - but the same error. But file_get_contents for - also returned string? I thought the right way was to get bytes from image and for that I used fopen($file_name, "rb"); If there is a way to set example image as image text ? I mean just any small image just to check if the error was in wrong data format ?
  5. Hello,Making adding of files to mailchimp as it is written here: https://developer.mailchimp.com/documentation/mailchimp/reference/file-manager/files/ I do like : $ch = curl_init( $url ); curl_setopt( $ch, CURLOPT_USERPWD, 'user:mykey' ); curl_setopt( $ch, CURLOPT_HTTPHEADER, [ 'Content-Type: application/json' ] ); curl_setopt( $ch, CURLOPT_RETURNTRANSFER, true ); curl_setopt( $ch, CURLOPT_TIMEOUT, 10 ); curl_setopt( $ch, CURLOPT_CUSTOMREQUEST, 'POST' ); curl_setopt( $ch, CURLOPT_SSL_VERIFYPEER, false ); curl_setopt( $ch, CURLOPT_POSTFIELDS, json_encode( $fileInfo ) ); $newFile = json_decode( curl_exec( $ch ) ); $fileInfo = [ 'name' => $file_name, 'folder_id => 5673, 'file_data'=> $file_data ]; $file_name - is name of file like '0001.jpg', 5673 - id of folder and $file_data is content of file I read using lines like $fd = fopen($file_name, "rb"); $contents = fread($fd, filesize($file_name)); fclose($fd); $url is https://us7.api.mailchimp.com/3.0/file-manager/files I got error [message] => Schema describes object, NULL found instead I am sure tha $url - is right and it has value - I get list of files using GET method for $url https://us7.api.mailchimp.com/3.0/file-manager/files What can the resason of this error? Is it wrong format of source file ? Thanks!
  6. Hello,In my products store site with many categories of products I need to give possibility for users to become subscribersfor some categories. I suppose that any categories of products must correspond to List ID of mailchimp List I found example like http://www.codexworld.com/add-subscriber-to-list-mailchimp-api-php/ It uses List ID and that is clear. The question is if there is a way to retrieve from mailchimp listing of all List ID(key and title)?I looked some examples, but did not find a way to make it ... Thanks!
  7. Hello, In WordPress/WooCommerce application I need to make that if some user is not logged by clicking on link to open popup dialog and login in it. Are there some examples/pluging to make it : on successfull login redirect to homepage on failure to show error to prepose to login again. I would prefer code sample as I need to implement it in my own popup dialog. Thanks!
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.